{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"PERS SDK Introduction"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PERS SDK / ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-reference/modules"},"children":["Exports"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"pers-sdk-introduction","__idx":0},"children":["PERS SDK Introduction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The PERS SDK is a platform-agnostic TypeScript library that provides a clean, modern interface for integrating with the PERS (Phygital Experience Rewards System) platform. Built with a Manager-Service architecture, it offers consistent APIs for tourism loyalty applications across web, mobile, and server environments."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-is-pers","__idx":1},"children":["What is PERS?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PERS is a comprehensive tourism loyalty platform that bridges physical and digital experiences through:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Loyalty Programs"]}," - Token-based reward systems"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Campaign Management"]}," - Marketing campaigns and challenges"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Business Operations"]}," - Merchant and venue management"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payment Processing"]}," - Integrated payment solutions"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Blockchain Integration"]}," - Web3 and digital token support"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Analytics"]}," - Comprehensive reporting and insights"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"installation","__idx":2},"children":["Installation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Core SDK + required peer dependencies\nnpm install @explorins/pers-sdk @explorins/pers-shared ethers@^6.15.0\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"quick-start","__idx":3},"children":["Quick Start"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"basic-setup","__idx":4},"children":["Basic Setup"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { PersSDK } from \"@explorins/pers-sdk\";\nimport { BrowserFetchClientAdapter } from \"@explorins/pers-sdk/platform-adapters\";\n\nconst sdk = new PersSDK(new BrowserFetchClientAdapter(), {\n  environment: \"production\",\n  // API Project Key is used to identify the Tenant Context.\n  // It does NOT authenticate the user or admin.\n  apiProjectKey: \"your-project-key\"\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"authentication-flow","__idx":5},"children":["Authentication Flow"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"// Login with external JWT (Firebase, Auth0, etc.)\n// This wraps the /auth/token endpoint using SessionAuthRequestDTO\nawait sdk.auth.loginWithToken(firebaseJWT, \"user\");\n\n// Alternative: Login with raw user data (guest/anonymous users)\nawait sdk.auth.loginWithRawData({\n  externalId: \"guest-123\",\n  email: \"guest@example.com\",\n  firstName: \"Guest\"\n});\n\n// Check authentication status\nif (await sdk.auth.isAuthenticated()) {\n  const user = await sdk.auth.getCurrentUser();\n  console.log(\"Welcome,\", user.name);\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"core-operations","__idx":6},"children":["Core Operations"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"// Business operations\nconst businesses = await sdk.businesses.getActiveBusinesses();\nconst business = await sdk.businesses.getBusinessById(\"business-123\");\n\n// Campaign management\nconst campaigns = await sdk.campaigns.getActiveCampaigns();\nconst claim = await sdk.campaigns.claimCampaign({\n  campaignId: \"campaign-123\",\n  businessId: \"business-456\"  // Optional business context\n});\n\n// Token operations - get available tokens\nconst tokens = await sdk.tokens.getTokens();\nconst creditToken = await sdk.tokens.getActiveCreditToken();\n\n// Transaction history\nconst transactions = await sdk.transactions.getUserTransactionHistory('ALL');\n\n// File operations\nconst uploadUrl = await sdk.files.getSignedPutUrl(\"entity-123\", \"profile-image\", \"jpg\");\nconst downloadUrl = await sdk.files.getSignedGetUrl(\"entity-123\", \"profile-image\");\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"platform-integration","__idx":7},"children":["Platform Integration"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"angular","__idx":8},"children":["Angular"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { Injectable } from \"@angular/core\";\nimport { HttpClient } from \"@angular/common/http\";\nimport { PersSDK } from \"@explorins/pers-sdk\";\nimport { AngularHttpClientAdapter } from \"@explorins/pers-sdk/platform-adapters\";\n\n@Injectable({ providedIn: \"root\" })\nexport class PersSDKService {\n  private sdk: PersSDK;\n\n  constructor(httpClient: HttpClient) {\n    this.sdk = new PersSDK(new AngularHttpClientAdapter(httpClient), {\n      environment: \"production\",\n      apiProjectKey: \"your-project-key\" // Tenant Context ID\n    });\n  }\n\n  getSDK(): PersSDK {\n    return this.sdk;\n  }\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"reactbrowser","__idx":9},"children":["React/Browser"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { PersSDK } from \"@explorins/pers-sdk\";\nimport { BrowserFetchClientAdapter } from \"@explorins/pers-sdk/platform-adapters\";\n\nconst sdk = new PersSDK(new BrowserFetchClientAdapter(), {\n  environment: \"production\",\n  apiProjectKey: \"your-project-key\"\n});\n\n// React Hook example\nexport function usePersSDK() {\n  return sdk;\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"nodejs","__idx":10},"children":["Node.js"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { PersSDK } from \"@explorins/pers-sdk\";\nimport { NodeHttpClientAdapter } from \"@explorins/pers-sdk/platform-adapters\";\n\nconst sdk = new PersSDK(new NodeHttpClientAdapter(), {\n  environment: \"production\",\n  apiProjectKey: \"your-project-key\"\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"architecture-overview","__idx":11},"children":["Architecture Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK follows a clean Manager-Service pattern:"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"manager-layer-primary-interface","__idx":12},"children":["Manager Layer (Primary Interface)"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.auth"]}," - Authentication and user sessions"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.users"]}," - User profile management"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.userStatus"]}," - User status/tier management"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.tokens"]}," - Token operations and balances"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.businesses"]}," - Business operations"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.campaigns"]}," - Marketing campaigns"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.redemptions"]}," - Reward redemptions"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.transactions"]}," - Transaction history"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.purchases"]}," - Purchase and payment processing"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.files"]}," - File upload and management"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.analytics"]}," - Reporting and insights"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.tenants"]}," - Multi-tenant configuration"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.apiKeys"]}," - API key management (admin)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.donations"]}," - Charitable giving and donations"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sdk.web3"]}," - Blockchain operations and token balances"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"service-layer-advanced-access","__idx":13},"children":["Service Layer (Advanced Access)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For advanced operations, you can access services directly:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const userService = sdk.users.getUserService();\nconst campaignService = sdk.campaigns.getCampaignService();\nconst fileService = sdk.files.getFileService();\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"core-features","__idx":14},"children":["Core Features"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"authentication-system","__idx":15},"children":["Authentication System"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["External JWT integration (Firebase, Auth0, custom providers)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Native token validation and refresh"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Support for both user and admin authentication flows"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Automatic token management and renewal"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"business-management","__idx":16},"children":["Business Management"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Business registration and profile management"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Business type categorization"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Public business discovery"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Admin tools for business operations"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"campaign-system","__idx":17},"children":["Campaign System"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create and manage marketing campaigns"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["User participation and claim tracking"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Advanced campaign triggers and automation"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Analytics and performance metrics"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"token-economy","__idx":18},"children":["Token Economy"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Multi-token support (credit, reward, utility tokens)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Balance management and transfers"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Transaction history and analytics"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Integration with external payment systems"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"user-token-balances-on-chain","__idx":19},"children":["User Token Balances (On-Chain)"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Important"]},": User token balances are queried directly from the blockchain via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sdk.web3.*"]}," methods, not stored in the PERS backend. See the npm package README for detailed examples."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"file-management","__idx":20},"children":["File Management"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Secure file upload and download"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Signed URL generation for direct browser access"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Media optimization and processing"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Cloud storage integration"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"reward-redemptions","__idx":21},"children":["Reward Redemptions"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Flexible redemption offer system"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["User redemption tracking"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Multiple redemption types (discounts, products, experiences)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Inventory management"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configuration","__idx":22},"children":["Configuration"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"interface PersConfig {\n  environment?: \"staging\" | \"production\"; // Default: 'production'\n  apiProjectKey: string; // Tenant Context Identifier (NOT for Auth)\n  authStorage?: TokenStorage;  // Default: LocalStorage, recommend IndexedDB\n  dpop?: { enabled?: boolean }; // Default: true (security feature)\n  timeout?: number;\n  retries?: number;\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"environment-configuration","__idx":23},"children":["Environment Configuration"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["development"]}," - Local development and testing"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["staging"]}," - Pre-production testing"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["production"]}," - Live environment"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"authentication-options","__idx":24},"children":["Authentication Options"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can provide a custom authentication provider or let the SDK create one automatically:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"// Auto-created provider (recommended)\nconst sdk = new PersSDK(httpClient, {\n  environment: \"production\",\n  apiProjectKey: \"your-key\"\n});\n\n// Custom provider\nconst sdk = new PersSDK(httpClient, {\n  environment: \"production\",\n  apiProjectKey: \"your-key\",\n  authProvider: customAuthProvider\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-handling","__idx":25},"children":["Error Handling"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { PersApiError, AuthenticationError } from \"@explorins/pers-sdk/core\";\n\ntry {\n  const user = await sdk.auth.getCurrentUser();\n} catch (error) {\n  if (error instanceof AuthenticationError) {\n    // Handle 401 - redirect to login\n  } else if (error instanceof PersApiError) {\n    console.error(\"API Error:\", error.message, error.status);\n  }\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"performance-features","__idx":26},"children":["Performance Features"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bundle Size"]},": ~85 KB minified"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tree-shaking"]},": Import only what you need"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Zero External Auth Dependencies"]},": Native browser APIs"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Intelligent Token Refresh"]},": Background refresh with race condition protection"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Optimization"]},": Automatic retry and timeout handling"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"typescript-support","__idx":27},"children":["TypeScript Support"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK provides full TypeScript support with type inference. All domain types are exported from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@explorins/pers-shared"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import type { CampaignDTO, BusinessDTO, TokenDTO } from '@explorins/pers-shared';\n\nconst campaigns = await sdk.campaigns.getActiveCampaigns(); // CampaignDTO[]\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"advanced-usage","__idx":28},"children":["Advanced Usage"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"direct-api-access","__idx":29},"children":["Direct API Access"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For operations not covered by managers:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const apiClient = sdk.api();\nconst customData = await apiClient.get(\"/custom-endpoint\");\nawait apiClient.post(\"/custom-endpoint\", data);\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"custom-http-client","__idx":30},"children":["Custom HTTP Client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement your own HTTP client for specific requirements:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { HttpClient, RequestOptions } from \"@explorins/pers-sdk/core\";\n\nclass CustomHttpClient implements HttpClient {\n  async get<T>(url: string, options?: RequestOptions): Promise<T> {\n    // Your implementation\n  }\n  // ... other methods\n}\n\nconst sdk = new PersSDK(new CustomHttpClient(), config);\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"web3--blockchain-operations","__idx":31},"children":["Web3 / Blockchain Operations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Query token balances and owned NFTs directly from the blockchain:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"// Get reward tokens configuration\nconst rewardTokens = await sdk.tokens.getRewardTokens();\n\n// Query owned tokens for any wallet address\nconst result = await sdk.web3.getAccountOwnedTokensFromContract(\n  walletAddress,\n  rewardTokens[0]\n);\n\nconsole.log(`Wallet owns ${result.totalOwned} tokens`);\nresult.ownedTokens.forEach(token => {\n  console.log(`- ${token.metadata?.name}: ${token.balance}`);\n});\n\n// Get blockchain explorer URL\nconst explorerUrl = await sdk.web3.getExplorerUrl(\n  chainId,\n  transactionHash,\n  'tx'\n);\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-packages","__idx":32},"children":["Related Packages"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.npmjs.com/package/@explorins/pers-sdk-react-native"},"children":["@explorins/pers-sdk-react-native"]}]}," - React Native integration with passkey support, secure storage, and DPoP. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use this for React Native apps"]}," instead of the core SDK."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.npmjs.com/package/@explorins/pers-shared"},"children":["@explorins/pers-shared"]}]}," - Shared types, interfaces, and DTOs used across PERS ecosystem (required peer dependency)"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"support-and-resources","__idx":33},"children":["Support and Resources"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Package"]},": ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.npmjs.com/package/@explorins/pers-sdk"},"children":["npm package"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Platform Documentation"]},": ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.pers.ninja/1.intro"},"children":["PERS Platform Docs"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Support"]},": Contact support@explorins.com for issues and feature requests"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"license","__idx":34},"children":["License"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["MIT License - See package for full license details."]}]},"headings":[{"value":"PERS SDK Introduction","id":"pers-sdk-introduction","depth":1},{"value":"What is PERS?","id":"what-is-pers","depth":2},{"value":"Installation","id":"installation","depth":2},{"value":"Quick Start","id":"quick-start","depth":2},{"value":"Basic Setup","id":"basic-setup","depth":3},{"value":"Authentication Flow","id":"authentication-flow","depth":3},{"value":"Core Operations","id":"core-operations","depth":3},{"value":"Platform Integration","id":"platform-integration","depth":2},{"value":"Angular","id":"angular","depth":3},{"value":"React/Browser","id":"reactbrowser","depth":3},{"value":"Node.js","id":"nodejs","depth":3},{"value":"Architecture Overview","id":"architecture-overview","depth":2},{"value":"Manager Layer (Primary Interface)","id":"manager-layer-primary-interface","depth":3},{"value":"Service Layer (Advanced Access)","id":"service-layer-advanced-access","depth":3},{"value":"Core Features","id":"core-features","depth":2},{"value":"Authentication System","id":"authentication-system","depth":3},{"value":"Business Management","id":"business-management","depth":3},{"value":"Campaign System","id":"campaign-system","depth":3},{"value":"Token Economy","id":"token-economy","depth":3},{"value":"User Token Balances (On-Chain)","id":"user-token-balances-on-chain","depth":3},{"value":"File Management","id":"file-management","depth":3},{"value":"Reward Redemptions","id":"reward-redemptions","depth":3},{"value":"Configuration","id":"configuration","depth":2},{"value":"Environment Configuration","id":"environment-configuration","depth":3},{"value":"Authentication Options","id":"authentication-options","depth":3},{"value":"Error Handling","id":"error-handling","depth":2},{"value":"Performance Features","id":"performance-features","depth":2},{"value":"TypeScript Support","id":"typescript-support","depth":2},{"value":"Advanced Usage","id":"advanced-usage","depth":2},{"value":"Direct API Access","id":"direct-api-access","depth":3},{"value":"Custom HTTP Client","id":"custom-http-client","depth":3},{"value":"Web3 / Blockchain Operations","id":"web3--blockchain-operations","depth":3},{"value":"Related Packages","id":"related-packages","depth":2},{"value":"Support and Resources","id":"support-and-resources","depth":2},{"value":"License","id":"license","depth":2}],"frontmatter":{"seo":{"title":"PERS SDK Introduction"}},"lastModified":"2026-08-21T19:40:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/sdk-reference/readme","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}