Authentication
Get credentials and authorize the Multiset client before starting a session
Get Your Credentials
Open the Multiset Developer Portal and navigate to the Credentials section. Copy your Client ID and Client Secret.
Your Map Code or Map Set Code is listed in the Maps section of the portal (format: MAP_XXXXXXXXXX).
Authorize the Client
Create a MultisetClient and call authorize() before starting an AR session. Authorization exchanges your credentials for a short-lived access token used in all subsequent API calls.
import { MultisetClient } from '@multisetai/vps/core';
const client = new MultisetClient({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECRET',
mapType: 'map', // 'map', 'map-set', or 'object-tracking'
code: 'MAP_XXXXXXXXXX',
});
await client.authorize();For a MapSet, change mapType to 'map-set' and pass the map set code:
const client = new MultisetClient({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECRET',
mapType: 'map-set',
code: 'MAPSET_XXXXXXXXXX',
});Call authorize() once before any localization or tracking request. If the token expires during a long session, call it again to refresh.
CORS Configuration
Localization requests are made directly from the browser to the Multiset API. Your domain must be added to the allowlist or every request will fail with a CORS error.
Follow the steps in Configuring Allowed Domains (CORS) before going to production.
Environment Variables
Avoid hardcoding credentials in source code. Use environment variables and load them at build time:
Client credentials are visible to anyone who inspects your bundle. For production apps, proxy the authorize() call through your own backend and return only the token to the browser.
Last updated
Was this helpful?

