{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Interface: PersConfig"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/readme"},"children":["PERS SDK - v2.3.26"]}," / ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/modules"},"children":["Exports"]}," / PersConfig"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"interface-persconfig","__idx":0},"children":["Interface: PersConfig"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PERS SDK Configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Example"]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"// Production setup\nconst config: PersConfig = {\n  environment: 'production',\n  apiProjectKey: 'your-project-key',\n};\n\n// Custom API URL (for development/testing)\nconst devConfig: PersConfig = {\n  customApiUrl: 'https://my-local-api.ngrok.io/v2',\n  apiProjectKey: 'your-project-key',\n};\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"table-of-contents","__idx":1},"children":["Table of contents"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"properties","__idx":2},"children":["Properties"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#environment"},"children":["environment"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#customapiurl"},"children":["customApiUrl"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#apiprojectkey"},"children":["apiProjectKey"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#apiversion"},"children":["apiVersion"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#timeout"},"children":["timeout"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#retries"},"children":["retries"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#authtype"},"children":["authType"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#authstorage"},"children":["authStorage"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#dpop"},"children":["dpop"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#authprovider"},"children":["authProvider"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#tokenrefreshmargin"},"children":["tokenRefreshMargin"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#backgroundrefreshthreshold"},"children":["backgroundRefreshThreshold"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#capturewalletevents"},"children":["captureWalletEvents"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#walleteventswsurl"},"children":["walletEventsWsUrl"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#autorestoresession"},"children":["autoRestoreSession"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#datasource"},"children":["dataSource"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#platform"},"children":["platform"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persconfig#apiroot"},"children":["apiRoot"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"properties-1","__idx":3},"children":["Properties"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"environment","__idx":4},"children":["environment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["environment"]},": ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/modules#persenvironment"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PersEnvironment"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Target environment - 'staging' or 'production' (default: 'production')"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in","__idx":5},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L40"},"children":["core/pers-config.ts:40"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"customapiurl","__idx":6},"children":["customApiUrl"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["customApiUrl"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Custom API URL - overrides environment setting."," ","Use this for local development or custom deployments."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-1","__idx":7},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L46"},"children":["core/pers-config.ts:46"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apiprojectkey","__idx":8},"children":["apiProjectKey"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["apiProjectKey"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Project key for API authentication"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-2","__idx":9},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L49"},"children":["core/pers-config.ts:49"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apiversion","__idx":10},"children":["apiVersion"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["apiVersion"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"v2\""]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API version to use (default: 'v2')"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-3","__idx":11},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L52"},"children":["core/pers-config.ts:52"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"timeout","__idx":12},"children":["timeout"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["timeout"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Request timeout in milliseconds (default: 30000)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-4","__idx":13},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L55"},"children":["core/pers-config.ts:55"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"retries","__idx":14},"children":["retries"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["retries"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Number of retry attempts (default: 3)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-5","__idx":15},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L58"},"children":["core/pers-config.ts:58"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"authtype","__idx":16},"children":["authType"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["authType"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AccountOwnerType"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Authentication type for auto-created provider (default: AccountOwnerType.USER)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-6","__idx":17},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L61"},"children":["core/pers-config.ts:61"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"authstorage","__idx":18},"children":["authStorage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["authStorage"]},": ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/tokenstorage"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TokenStorage"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Custom token storage for auto-created provider"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Recommendation"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["new IndexedDBTokenStorage()"]}," for better security/performance"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-7","__idx":19},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L68"},"children":["core/pers-config.ts:68"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"dpop","__idx":20},"children":["dpop"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["dpop"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Object"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["DPoP (Demonstrating Proof-of-Possession) Configuration for auto-created provider"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"type-declaration","__idx":21},"children":["Type declaration"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["enabled?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Enable DPoP (default: true)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cryptoProvider?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/dpopcryptoprovider"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DPoPCryptoProvider"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Custom Crypto Provider (optional)"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-8","__idx":22},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L71"},"children":["core/pers-config.ts:71"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"authprovider","__idx":23},"children":["authProvider"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["authProvider"]},": ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/interfaces/persauthprovider"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PersAuthProvider"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Authentication provider instance (overrides authType if provided)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-9","__idx":24},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L79"},"children":["core/pers-config.ts:79"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"tokenrefreshmargin","__idx":25},"children":["tokenRefreshMargin"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["tokenRefreshMargin"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Seconds before expiry to refresh token proactively (default: 60)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-10","__idx":26},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L82"},"children":["core/pers-config.ts:82"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"backgroundrefreshthreshold","__idx":27},"children":["backgroundRefreshThreshold"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["backgroundRefreshThreshold"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Seconds threshold for background vs blocking refresh (default: 30)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-11","__idx":28},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L85"},"children":["core/pers-config.ts:85"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"capturewalletevents","__idx":29},"children":["captureWalletEvents"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["captureWalletEvents"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Enable real-time wallet events (default: true)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When enabled, SDK auto-connects to wallet events after authentication."," ","Events are streamed through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sdk.events"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sdk.walletEvents"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-12","__idx":30},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L97"},"children":["core/pers-config.ts:97"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"walleteventswsurl","__idx":31},"children":["walletEventsWsUrl"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["walletEventsWsUrl"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Custom wallet events WebSocket URL - overrides environment default."," ","Default: wss://events.pers.ninja (production) or wss://dev.events.pers.ninja (staging)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-13","__idx":32},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L103"},"children":["core/pers-config.ts:103"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"autorestoresession","__idx":33},"children":["autoRestoreSession"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["autoRestoreSession"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Automatically restore session from stored tokens on SDK initialization (default: true)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When enabled, SDK checks for valid stored tokens during construction and"," ","automatically restores the user session. This eliminates the need to"," ","manually call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["restoreSession()"]}," and prevents \"logged out\" flash on app start."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The restoration runs asynchronously and emits 'session_restored' event on success."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," if you need manual control over session restoration timing."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-14","__idx":34},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L120"},"children":["core/pers-config.ts:120"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"datasource","__idx":35},"children":["dataSource"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["dataSource"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DataSource"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Default data source for analytics tracking."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sets tracking headers on all API requests for attribution:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-source-channel"]},": Primary ingestion channel (web, mobile, api, etc.)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-source-medium"]},": Marketing medium (email, referral, organic, etc.)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-source-campaign"]},": Campaign identifier for tracking"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-source"]},": Traffic source reference"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Example"]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"// Simple channel tracking\nconst config: PersConfig = {\n  dataSource: { channel: 'mobile' }\n};\n\n// Full attribution tracking\nconst config: PersConfig = {\n  dataSource: {\n    channel: 'web',\n    medium: 'email',\n    campaign: 'summer_promo_2026',\n    source: 'mailchimp'\n  }\n};\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-15","__idx":36},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L153"},"children":["core/pers-config.ts:153"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"platform","__idx":37},"children":["platform"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["platform"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Platform"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Platform information for analytics."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sent as JSON in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-platform"]}," header for device/browser analytics:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Native: os, osVersion, app, appVersion, deviceType"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Web: os, browser, browserVersion, deviceType"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Example"]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"// Native app\nconst config: PersConfig = {\n  platform: {\n    os: 'iOS',\n    osVersion: '17.4',\n    app: 'MyApp',\n    appVersion: '2.3.1',\n    deviceType: 'phone'\n  }\n};\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-16","__idx":38},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L176"},"children":["core/pers-config.ts:176"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apiroot","__idx":39},"children":["apiRoot"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Readonly"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["apiRoot"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Internal - API root URL constructed automatically"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"defined-in-17","__idx":40},"children":["Defined in"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/core/pers-config.ts#L179"},"children":["core/pers-config.ts:179"]}]}]},"headings":[{"value":"Interface: PersConfig","id":"interface-persconfig","depth":1},{"value":"Table of contents","id":"table-of-contents","depth":2},{"value":"Properties","id":"properties","depth":3},{"value":"Properties","id":"properties-1","depth":2},{"value":"environment","id":"environment","depth":3},{"value":"Defined in","id":"defined-in","depth":4},{"value":"customApiUrl","id":"customapiurl","depth":3},{"value":"Defined in","id":"defined-in-1","depth":4},{"value":"apiProjectKey","id":"apiprojectkey","depth":3},{"value":"Defined in","id":"defined-in-2","depth":4},{"value":"apiVersion","id":"apiversion","depth":3},{"value":"Defined in","id":"defined-in-3","depth":4},{"value":"timeout","id":"timeout","depth":3},{"value":"Defined in","id":"defined-in-4","depth":4},{"value":"retries","id":"retries","depth":3},{"value":"Defined in","id":"defined-in-5","depth":4},{"value":"authType","id":"authtype","depth":3},{"value":"Defined in","id":"defined-in-6","depth":4},{"value":"authStorage","id":"authstorage","depth":3},{"value":"Defined in","id":"defined-in-7","depth":4},{"value":"dpop","id":"dpop","depth":3},{"value":"Type declaration","id":"type-declaration","depth":4},{"value":"Defined in","id":"defined-in-8","depth":4},{"value":"authProvider","id":"authprovider","depth":3},{"value":"Defined in","id":"defined-in-9","depth":4},{"value":"tokenRefreshMargin","id":"tokenrefreshmargin","depth":3},{"value":"Defined in","id":"defined-in-10","depth":4},{"value":"backgroundRefreshThreshold","id":"backgroundrefreshthreshold","depth":3},{"value":"Defined in","id":"defined-in-11","depth":4},{"value":"captureWalletEvents","id":"capturewalletevents","depth":3},{"value":"Defined in","id":"defined-in-12","depth":4},{"value":"walletEventsWsUrl","id":"walleteventswsurl","depth":3},{"value":"Defined in","id":"defined-in-13","depth":4},{"value":"autoRestoreSession","id":"autorestoresession","depth":3},{"value":"Defined in","id":"defined-in-14","depth":4},{"value":"dataSource","id":"datasource","depth":3},{"value":"Defined in","id":"defined-in-15","depth":4},{"value":"platform","id":"platform","depth":3},{"value":"Defined in","id":"defined-in-16","depth":4},{"value":"apiRoot","id":"apiroot","depth":3},{"value":"Defined in","id":"defined-in-17","depth":4}],"frontmatter":{"seo":{"title":"Interface: PersConfig"}},"lastModified":"2026-08-21T18:40:55.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/sdk-reference/interfaces/persconfig","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}