### Initialize Entitlements Client Source: https://docs.sudoplatform.com/guides/entitlements/end-user-api/integrate-the-entitlements-sdk Instantiate a client in your application. Ensure you have followed the 'Getting Started' and 'User SDK' integration guides. You only need one client instance per user per device. ```javascript const DefaultSudoEntitlementsClient = require('@sudoplatform/sudo-entitlements') .DefaultSudoEntitlementsClient const userClient = // see "Users" docs const entitlementsClient = new DefaultSudoEntitlementsClient(userClient) ``` -------------------------------- ### Initialize VPN Client (Android) Source: https://docs.sudoplatform.com/guides/virtual-private-network/integrate-the-vpn-sdk Instantiate the VPN client using a builder pattern, providing the application context and the Sudo user client. Ensure prerequisites like Getting Started and User SDK integration are met. Only one client instance is needed per user per device. ```kotlin val userClient = // ... see "Users" docs val vpnClient = SudoVPNClient.builder() .setContext(appContext) .setSudoUserClient(userClient) .build() ``` -------------------------------- ### Install Telephony SDK (iOS) Source: https://docs.sudoplatform.com/guides/telephony/integrate-the-telephony-sdk Add the SudoTelephony pod to your Podfile and run `pod install --repo-update` to install the SDK and update dependencies. ```bash pod 'SudoTelephony' ``` ```bash pod install --repo-update ``` -------------------------------- ### Instantiate Email Client Source: https://docs.sudoplatform.com/guides/email/integrate-the-email-sdk Instantiate the Email client using the SudoEmailClient.builder. Ensure you have followed the prerequisites for Getting Started, User SDK, and Sudo Profiles SDK. You only need one client instance per user per device. ```kotlin val userClient = // ... see "Users" docs val emailClient = SudoEmailClient.builder() .setContext(appContext) .setSudoUserClient(userClient) .build() ``` -------------------------------- ### Setup Provisional Funding Source (Kotlin) Source: https://docs.sudoplatform.com/guides/virtual-cards/manage-funding-sources Initiates the funding source setup process for virtual cards. This Kotlin snippet requires specifying currency, funding source type, client application data, and supported providers. It returns a provisional funding source with necessary provisioning data. ```kotlin launch { try { val setupInput = SetupFundingSourceInput( "USD", FundingSourceType.CREDIT_CARD, ClientApplicationData("yourApplicationName"), // include only the provider(s) you will support listOf("stripe") val provisionalFundingSource = withContext(Dispatchers.IO) { virtualCardsClient.setupFundingSource( setupInput ) } // The returned [provisionalFundingSource] has been created. } catch (e: FundingSourceException) { // Handle/notify user of exception } } ``` -------------------------------- ### Instantiate Ad/Tracker Blocker Client in Swift Source: https://docs.sudoplatform.com/guides/ad-tracker-blocker/integrate-the-ad-tracker-blocker-sdk Instantiate an Ad/Tracker Blocker client in your Swift application. Ensure you have followed the Getting Started and User SDK integration guides. Only one client instance is needed per user per device. ```swift let userClient: SudoUserClient! let config = try SudoAdTrackerBlockerConfig(userClient: userClient) let client = DefaultSudoAdTrackerBlockerClient(config: config) ``` -------------------------------- ### Install JS SDK Source: https://docs.sudoplatform.com/guides/entitlements/administrative-api/integrating-the-administrative-api Install the Sudo Entitlements Admin SDK for your Web or Node.js project using either Yarn or npm package managers. ```bash yarn add '@sudoplatform/sudo-entitlements-admin' # or npm install --save '@sudoplatform/sudo-entitlements-admin' ``` -------------------------------- ### Install SudoProfiles SDK for JS Source: https://docs.sudoplatform.com/guides/sudos/integrate-the-sudo-sdk Install the Sudo Profiles SDK for JavaScript projects using either Yarn or npm. This command adds the necessary package to your project dependencies. ```bash yarn add '@sudoplatform/sudo-profiles' # or npm install --save '@sudoplatform/sudo-profiles' ``` -------------------------------- ### Complete Stripe Funding Source Setup (Kotlin) Source: https://docs.sudoplatform.com/guides/virtual-cards/manage-funding-sources Completes the funding source setup with Stripe using provider-specific data. This Kotlin snippet requires the provisional funding source ID and a StripeCardProviderCompletionData object containing the payment method ID obtained from Stripe. ```kotlin launch { try { val completionData = StripeCardProviderCompletionData( paymentMethodId // This is the payment method identifier of the Stripe SetupIntent success response. ) val completeInput = CompleteFundingSourceInput( provisionalFundingSource.id, completionData, null ) val fundingSource = withContext(Dispatchers.IO) { virtualCardsClient.completeFundingSource( completeInput ) } // The returned [fundingSource] has been created. } catch (e: FundingSourceException) { // Handle/notify user of exception } } ``` -------------------------------- ### Add JS SDK Dependency Source: https://docs.sudoplatform.com/guides/site-reputation/integrate-the-site-reputation-sdk Install the Site Reputation JS SDK using Yarn or npm. Ensure you have completed the Getting Started and User SDK integration guides. ```bash yarn add '@sudoplatform/sudo-site-reputation' # or npm install --save '@sudoplatform/sudo-site-reputation' ``` -------------------------------- ### Instantiate iOS Identity Verification Client Source: https://docs.sudoplatform.com/guides/identity-verification/integrate-the-identity-verification-sdk Instantiate the SudoIdentityVerificationClient using DefaultSudoIdentityVerificationClient. Ensure that the SudoUserClient is available and that prerequisite guides for Getting Started and User SDK integration have been followed. ```swift import SudoIdentityVerification do { let identityVerificationClient: SudoIdentityVerificationClient = try DefaultSudoIdentityVerificationClient( sudoUserClient: userClient ) } catch { // Handle initialization error. An error might be thrown due to invalid // or missing confiugration file. } ``` -------------------------------- ### Initialize Virtual Cards Simulator Client in Swift Source: https://docs.sudoplatform.com/guides/virtual-cards-simulator/untitled Instantiate the client using your Sudo Platform Administration Console username and password. Handle potential initialization errors. ```swift do { let username = // Username obtained from the Sudo Platform Admin Console let password = // Password obtained from the Sudo Platform Admin Console let simulatorClient = try DefaultSudoVirtualCardsSimulatorClient( username: username, password: password ) } catch { // Handle initialization error. An error might be thrown due to invalid // configuration. } ``` -------------------------------- ### Add Ad/Tracker Blocker SDK Dependency Source: https://docs.sudoplatform.com/guides/ad-tracker-blocker/integrate-the-ad-tracker-blocker-sdk Install the Ad/Tracker Blocker SDK package using yarn or npm. Ensure you have completed the Getting Started and User SDK prerequisites. ```bash yarn add '@sudoplatform/sudo-ad-tracker-blocker' # or npm install --save '@sudoplatform/sudo-ad-tracker-blocker' ``` -------------------------------- ### Setup Credit Card Funding Source (Swift) Source: https://docs.sudoplatform.com/guides/virtual-cards/manage-funding-sources Initiates the creation of a credit card funding source. Requires specifying the type, currency, and application data, along with supported providers. The returned provisional funding source contains data needed for the next step with the provider. ```swift try { let provisionalFundingSource = try await virtualCardsClient.setupFundingSource( withInput: SetupFundingSourceInput( type: .creditCard, currency: "USD", applicationData: ClientApplicationData(applicationName: "yourApplicationName")), // include only the provider(s) you will support supportedProviders: ["stripe"] ) ) } catch { // Handle/notify user of errors } ``` -------------------------------- ### Instantiate Ad/Tracker Blocker Client in Kotlin Source: https://docs.sudoplatform.com/guides/ad-tracker-blocker/integrate-the-ad-tracker-blocker-sdk Instantiate an Ad/Tracker Blocker client in your Kotlin application using the builder pattern. Ensure you have followed the Getting Started and User SDK integration guides. Only one client instance is needed per user per device. ```kotlin val logger = // ... use your implemenation of logger val userClient = // ... see "Users" docs val sudoAdTrackerBlocker = SudoAdTrackerBlockerClient.builder() .setContext(this) .setSudoUserClient(sudoUserClient) .setLogger(logger) .build() ``` -------------------------------- ### Accept Connection with Relay Routing (Kotlin) Source: https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/edge-agent-sdk/establishing-connections This Kotlin example demonstrates creating routing for accepting a new connection using a `Postbox` from the Sudo Relay SDK. It's recommended to create a new `Postbox` per connection to avoid peer correlation. ```kotlin val connectionExchangeId: String // The identifier of the [ConnectionExchange] val postbox: Postbox // A new postbox created by a sudo relay client. val relayRouting = SudoDIRelayMessageSource.routingFromPostbox(postbox) launch { try { agent.connections.exchange.acceptConnection( connectionExchangeId, AcceptConnectionConfiguration.NewConnection(relayRouting) ) } catch (e: ConnectionExchangeModule.AcceptConnectionException) { // Handle exception } } ``` -------------------------------- ### Get Supported Protocols on Android Source: https://docs.sudoplatform.com/guides/virtual-private-network/manage-connection The `listSupportedProtocols` method returns a list of protocols available for configuring a connection on the client device. This is useful for dynamic connection setup. ```kotlin val supportedProtocols = vpnClient.listSupportedProtocols() // [supportedProtocols] contains a list of protocols that can be used to configure a connection. ``` -------------------------------- ### Connect to the VPN Source: https://docs.sudoplatform.com/guides/virtual-private-network/manage-connection Use the `connect()` method to establish a VPN connection. If no configuration is provided, it defaults to the fastest server and protocol. Check the connection status using `getState()`. ```typescript try { await vpnClient.connect() } catch (err) { // log error and/or retry/recover } if(await vpnClient.getState() == SudoVPNConnectionStatus.connected) { // vpn is connected } ``` -------------------------------- ### Query Site Reputation Documentation Source: https://docs.sudoplatform.com/guides/site-reputation This is a GET request example to query the documentation dynamically. Use the 'ask' query parameter with a specific question to retrieve relevant information. ```http GET https://docs.sudoplatform.com/guides/site-reputation.md?ask= ``` -------------------------------- ### Setup Credit Card Funding Source (TypeScript) Source: https://docs.sudoplatform.com/guides/virtual-cards/manage-funding-sources Initiates the creation of a credit card funding source. Requires specifying the currency, type, application name, and supported providers. The returned provisional funding source contains data needed for the next step with the provider. ```typescript try { const provisionalFundingSource = await virtualCardsClient.setupFundingSource({ currency: 'USD', type: FundingSourceType.CreditCard, applicationName: 'yourApplicationName', // include only the provider(s) you will support supportedProviders: ['stripe'], }) } catch (error) { // Handle/notify user of errors } ``` -------------------------------- ### Handle Password Manager Registration Status Source: https://docs.sudoplatform.com/guides/password-manager/accessing-the-password-manager Inspect the `PasswordManagerRegistrationStatus` to guide the user through the Password Manager setup. This includes handling unregistered users, those requiring a secret code, or already registered users. ```Swift var client: PasswordManagerClient! client.getRegistrationStatus { (result) in switch result { case .success(let status): switch status { case .registered: break case .notRegistered: break case .missingSecretCode: break } case .failure(let error): break } } ``` -------------------------------- ### Instantiate and Initialize Identity Verification Client Source: https://docs.sudoplatform.com/guides/identity-verification/integrate-the-identity-verification-sdk Configure the SDK with your project's configuration file and set up the Sudo User client before instantiating the Identity Verification client. Ensure only one client instance is used per user per device. ```typescript import { DefaultConfigurationManager } from '@sudoplatform/sudo-common' import { DefaultSudoUserClient } from '@sudoplatform/sudo-user' import { DefaultApiClientManager } from '@sudoplatform/sudo-api-client' import { DefaultSudoSecureIdVerificationClient } from '@sudoplatform/sudo-secure-id-verification' // Set configuration (content of file downloaded in previous step) in the configuration manager DefaultConfigurationManager.getInstance().setConfig(configJson) // Set up Sudo User client const sudoUserClient = new DefaultSudoUserClient() DefaultApiClientManager.getInstance().setAuthClient(sudoUserClient) // Instantiate and initialize the client const client = new DefaultSudoSecureIdVerificationClient({ sudoUserClient }) ``` -------------------------------- ### Instantiate Relay Client in iOS Source: https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/relay-sdk/integrate-the-relay-sdk Instantiate the Relay client in your iOS application. Ensure you have followed the prerequisites for Getting Started, User SDK, and Sudo Profiles SDK. Only one client instance is needed per user per device. ```swift import SudoDIRelay let userClient = // ... see "Users" docs let relayClient = try DefaultSudoDIRelayClient( sudoUserClient: sudoUserClient ) ``` -------------------------------- ### Initialize Agent with Default Configuration (Swift) Source: https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/edge-agent-sdk/agent-management Builds a SudoDIEdgeAgent using a default configuration. Ensure a URL pointing to an Indy ledger genesis file is provided. ```swift let genesisFile: URL // a URL pointing to a indy-ledger genesis file on disk let networkConfiguration = NetworkConfiguration( sovConfiguration: NetworkConfiguration.Sov( genesisFiles: [genesisFile], namespace: "testnet" ), cheqdConfiguration: NetworkConfiguration.Cheqd() ) let agentConfiguration = AgentConfiguration(networkConfiguration: networkConfiguration) agent = try SudoDIEdgeAgentBuilder() .setAgentConfiguration(agentConfiguration: agentConfiguration) .build() ``` -------------------------------- ### Add Relay SDK Dependency in Android Source: https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/relay-sdk/integrate-the-relay-sdk Add the SudoDIRelay SDK dependency to your Android application's build.gradle file. The latest version can be found in the SDK Releases documentation. Ensure prerequisites for Getting Started, User SDK, and Sudo Profiles SDK are met. ```groovy dependencies { implementation 'com.sudoplatform:sudodirelay:$latest_version' } ``` -------------------------------- ### Create Sudo Profile Source: https://docs.sudoplatform.com/guides/sudos/managing-sudos Use this to create a new Sudo profile. Ensure your client is signed in and necessary entitlements are configured. ```swift do { let sudoInput = SudoCreateInput( title: "Mr.", firstName: "John", lastName: "Smith", label: "Shopping", notes: "Used for shopping.", avatar: .fileUrl(avatarUrl) ) let sudo = try await client.createSudo(input: sudoInput) // Create successful } catch { // Handle error. An error may be thrown if the backend is unable // to create the Sudo due to availability, security or entitlement issues or // due to unrecoverable circumstances arising from programmatic error or // configuration error. For example, if the keychain access entitlement // is not set up correctly, the client is not signed in, // or basic system resources are unavailable. } ``` ```kotlin val sudo = Sudo() sudo.title = "Mr." sudo.firstName = "John" sudo.lastName = "Smith" sudo.label = "Shopping" sudo.notes = "Used for shopping." sudo.avatar = avatarUri CoroutineScope(Dispatchers.IO).launch { try { client.createSudo(sudo) // Sudo created successfully. } catch (e: SudoProfileException) { // Handle error. } } ``` ```typescript import { Sudo } from '@sudoplatform/sudo-profiles' const sudo = new Sudo() sudo.title = "Mr." sudo.firstName = "John" sudo.lastName = "Smith" sudo.label = "Shopping" sudo.notes = "Used for shopping." sudo.setAvatar(avatarFile) try { const createdSudo = await client.createSudo(sudo) // Sudo created successfully. } catch(err) { // Handle error. } ``` -------------------------------- ### Complete Stripe Funding Source Setup (Swift) Source: https://docs.sudoplatform.com/guides/virtual-cards/manage-funding-sources Use this snippet to complete the funding source provisioning process with Stripe after obtaining provider-specific data. It requires the provisional funding source ID and the Stripe payment method ID. ```swift /// Stripe let completionData = StripeCompletionDataInput( paymentMethodId: paymentMethodId // This is the payment method identifier of the Stripe SetupIntent success response. ) try { let fundingSource = try await virtualCardsClient.completeFundingSource( withInput: CompleteFundingSourceInput( id: id, // This is the identifier of the provisional Funding Source. completionData: completionData ) ) } catch { // Handle/notify user of errors } ``` -------------------------------- ### Get Voicemail Source: https://docs.sudoplatform.com/guides/telephony/calling Get a Voicemail by its ID. ```APIDOC ## Get Voicemail ### Description Get a `Voicemail` by its ID. ### Method `getVoicemail` ### Parameters #### Path Parameters - **id** (String) - Required - The ID of the voicemail to retrieve. #### Query Parameters None ### Request Example ```swift // Swift Example telephonyClient.getVoicemail(id: voicemailId) ``` ```kotlin // Kotlin Example sudoTelephonyClient.calling.getVoicemail(voicemailId) ``` ### Response #### Success Response (200) - **voicemail** (Voicemail) - The requested voicemail object. #### Response Example ```json // Swift Success Example // voicemail: Voicemail // Kotlin Success Example // result.value: Voicemail ``` ``` -------------------------------- ### Initialize PKPushRegistry Source: https://docs.sudoplatform.com/guides/telephony/calling Set up the push registry in your application's launch function. Ensure the desiredPushTypes are set to .voIP. ```swift func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // ... self.pushRegistry = PKPushRegistry(queue: nil) pushRegistry.delegate = self pushRegistry.desiredPushTypes = [.voIP] return true } ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.sudoplatform.com/guides/virtual-cards-simulator/sdk-releases To get information not directly present on the page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.sudoplatform.com/guides/virtual-cards-simulator/sdk-releases.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/edge-agent-sdk/utilize-alternative-cryptography-providers To get information not explicitly on the page, perform an HTTP GET request to the page URL with an 'ask' query parameter containing your question. ```http GET https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/edge-agent-sdk/utilize-alternative-cryptography-providers.md?ask= ``` -------------------------------- ### Initialize VPN Client (TypeScript) Source: https://docs.sudoplatform.com/guides/virtual-private-network/integrate-the-vpn-sdk Instantiate and initialize the VPN client using necessary clients and key manager. Use WebSudoCryptoProvider for web environments and NativeSudoCryptoProvider for native environments. ```typescript import { DefaultSudoVPNClient } from '@sudoplatform/sudo-virtual-cards' import { DefaultSudoKeyManager } from '@sudoplatform/sudo-common' import { DefaultSudoUserClient } from '@sudoplatform/sudo-user' import { WebSudoCryptoProvider } from '@sudoplatform/sudo-web-crypto-provider' // OR import { NativeSudoCryptoProvider } from '@sudoplatform/sudo-native-crypto-provider' const sudoUserClient = new DefaultSudoUserClient(/* refer to Users documentation */) const sudoKeyManager = environment == 'web' ? /* if using browser 'secure storage' */ new WebSudoCryptoProvider('your.keymanager.namespace', 'your.servicename') : new NativeSudoCryptProvider('your.keymanager.namespace', 'your.servicename') const logPath = 'your path to log files' const vpnClient = new DefaultSudoVpnClient({ userClient, logPath, sudoKeyManager ) ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.sudoplatform.com/guides/virtual-cards/configuration Perform an HTTP GET request to a documentation page with an 'ask' query parameter to dynamically retrieve information. Use this for clarifications or to get related documentation. ```http GET https://docs.sudoplatform.com/guides/virtual-cards/configuration.md?ask= ``` -------------------------------- ### Create Simulated Authorization (Kotlin) Source: https://docs.sudoplatform.com/guides/virtual-cards-simulator/manage-authorizations This Kotlin example shows how to simulate an authorization using the `simulatorClient`. It requires a `SimulateAuthorizationInput` object and handles potential `AuthorizationException` errors. The `isApproved` property indicates the authorization status. ```kotlin val authInput = SimulateAuthorizationInput( cardNumber = "4242424242424242", amount = 4200, merchantId = "000000001", securityCode = "123", expirationMonth = 2, expirationYear = 2024 ) launch { try { val authorization = withContext(Dispatchers.IO) { simulatorClient.simulateAuthorization(authInput) } if (authorization.isApproved) { // Authorization has been approved } else { // Handle the authorization being declined // see authorization.declineReason for why } } catch (e: AuthorizationException) { // Handle/notify the user of exception } } ``` -------------------------------- ### Initialize VPN Client (iOS) Source: https://docs.sudoplatform.com/guides/virtual-private-network/integrate-the-vpn-sdk Instantiate the VPN client by providing a user client instance. Ensure a PersonalVPN entitlement capability is included in your application ID. Only one client instance is needed per user per device. ```swift import SudoVPN let userClient = // ... see "Users" docs do { let vpnClient = DefaultSudoVPNClient(userClient: userClient) } catch { // Handle initialization error. An error might be thrown due to invalid // or missing configuration file. } ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/error-codes To get more information not directly on the page, perform an HTTP GET request to the current page URL with the `ask` query parameter. The question should be specific and self-contained. ```http GET https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/error-codes.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/edge-agent-sdk/sdk-releases To get information not directly on the page, make an HTTP GET request to the current URL with the 'ask' query parameter. Use this for clarifications or to retrieve related documentation. ```http GET https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/edge-agent-sdk/sdk-releases.md?ask= ``` -------------------------------- ### Sign In with Private Key (Kotlin) Source: https://docs.sudoplatform.com/guides/users/authentication This Kotlin code snippet demonstrates signing in a user with a private key. Handle potential authentication exceptions related to backend availability or security. ```kotlin CoroutineScope(Dispatchers.IO).launch { try { val result = client.signInWithKey() // "idToken" can be used to initialize other service specific clients to authenticate to the backend API. // ID token and access token will expire after number of seconds specified in "lifetime" so use "refreshToken" // to refresh these tokens via "refreshTokens" API. println("idToken: ${result.idToken}, accessToken: ${result.accessToken}, refreshToken: ${result.refreshToken}") } catch (e: AuthenticationException) { // Handle error. A failure result may be returned if the backend is unable // to perform the sign in due to availability or security issues. println("${e.localizedMessage}") } } ``` -------------------------------- ### Connect to VPN - iOS Source: https://docs.sudoplatform.com/guides/virtual-private-network/manage-connection Use the `connect(withConfiguration:completion:)` method to initiate a VPN connection. The completion handler is invoked upon starting the connection process or if an error occurs. If configuration is nil, default settings are used. ```swift vpnClient.connect { result in switch result { case let .failure(cause): /// Handle/notify user of error. case .success: /// Successfully begun connection. } ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.sudoplatform.com/guides/password-manager/password-entitlements Perform an HTTP GET request on the current page URL with the `ask` query parameter to get specific answers from the documentation. ```http GET https://docs.sudoplatform.com/guides/password-manager/password-entitlements.md?ask= ``` -------------------------------- ### Setting Up A Subscription Source: https://docs.sudoplatform.com/guides/virtual-private-network/observe-vpn-related-events To subscribe to observing connection state events, use the `subscribe` method. An identifier of the subscription and a function that accepts the `SudoVPNConnectionStatus` as a parameter must be passed in. This function will be notified of changes to the connection state when the connection traverses between states. ```APIDOC ## Setting Up A Subscription To setup the subscription, call the `subscribe` method as so: ```typescript const subscriptionId = uuid() //unique id to identify the subscription const subscriber: (status: SudoVPNConnectionStatus) => void = (status) => { // ... } const subscribeResult = await sudoVpnClient.subscribe(subscriptionId, subscriber) ``` Valid States: `disconnected` `disconnecting` `connecting` `connected` `error` `unknown` ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://docs.sudoplatform.com/guides/entitlements/administrative-api/entitlement-definitions Explains how to dynamically query the documentation by making an HTTP GET request to the page URL with an 'ask' query parameter. ```http GET https://docs.sudoplatform.com/guides/entitlements/administrative-api/entitlement-definitions.md?ask= ``` -------------------------------- ### Install iOS Pod Dependencies Source: https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/edge-agent-sdk/integrate-the-wallet-sdk Run this command in your project directory to update the local CocoaPods repository and install the latest version of the Edge Agent SDK. ```bash pod install --repo-update ``` -------------------------------- ### Example: Updating an existing API (Major Version Increment) Source: https://docs.sudoplatform.com/development/versioning This diff shows an example of updating an existing API, which would result in a major version increment. ```diff + public func doSomething(param1: String) - public func doSomething(param1: String, param2: Boolean) ``` -------------------------------- ### Connect to VPN - Android Source: https://docs.sudoplatform.com/guides/virtual-private-network/manage-connection Initiate a VPN connection using `connect(notification, revokedNotification)`. Ensure `configuration` is set before connecting. The `prepare` method must be called to request user permission prior to connecting. ```kotlin class ConnectionFragment : Fragment(), CoroutineScope { companion object { private const val VPN_PREPARE = 1000 private const val NOTIFICATION_ID_VPN_STATUS = 1 private const val NOTIFICATION_ID_VPN_REVOKED = 2 } // val server: SudoVPNServer // Retrieved via the list servers API private fun connect() { try { if (sudoVPNClient.isPrepared()) { // Set the configuration client property with selected [server]. sudoVPNClient.configuration = SudoVPNConfiguration(server, SudoVPNProtocol.IKEV2, false) // Build SudoVPNNotification objects. val vpnConnectionNotification = NotificationCompat.Builder( requireContext(), "vpnNotificationChannel" ) .setSmallIcon(R.drawable.vpn_logo) .build() val vpnRevokedNotification = NotificationCompat.Builder( requireContext(), "vpnNotificationChannel" ) .setSmallIcon(R.drawable.vpn_logo) .build() val sudoNotification = SudoVPNNotification(NOTIFICATION_ID_VPN_STATUS, vpnConnectionNotification) val sudoRevokedNotification = SudoVPNNotification(NOTIFICATION_ID_VPN_REVOKED, vpnRevokedNotification) launch { try { withContext(Dispatchers.IO) { sudoVPNClient.connect(sudoNotification, sudoRevokedNotification) } } catch (e: SudoVPNException) { // Handle/notify user of exception } } } else { sudoVPNClient.prepare(this) } } catch (e: ActivityNotFoundException) { // Handle/notify user if prepare method could not be executed. } } // Handle result from calling [sudoVPNClient.prepare] method. override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (resultCode == RESULT_OK && requestCode == VPN_PREPARE) { connect() } } } ``` -------------------------------- ### Install VPN SDK Dependencies Source: https://docs.sudoplatform.com/guides/virtual-private-network/integrate-the-vpn-sdk Add the VPN SDK and its provider package to your project using Yarn or npm. This is required for Web and Node.js projects. ```bash yarn add '@sudoplatform/sudo-vpn' yarn add '@sudoplatform/sudo-vpn-provider' # or npm install --save '@sudoplatform/sudo-vpn' npm install --save '@sudoplatform/sudo-vpn-provider' ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.sudoplatform.com/development/versioning To get additional information not directly present on a page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.sudoplatform.com/development/versioning.md?ask= ``` -------------------------------- ### Instantiate and Initialize SudoUserClient in Swift Source: https://docs.sudoplatform.com/guides/users/integrate-the-user-sdk Instantiate and initialize the SudoUserClient using DefaultSudoUserClient. Ensure your SDK configuration file is present and valid to avoid initialization errors. ```swift do { let client: SudoUserClient = try DefaultSudoUserClient(keyNamespace: "") catch let error { // Handle initialization error. An error might be thrown due to invalid // or missing confiugration file. } ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.sudoplatform.com/guides/virtual-cards-simulator/api-reference Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query the documentation. The question should be specific and self-contained. ```http GET https://docs.sudoplatform.com/guides/virtual-cards-simulator/api-reference.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/credentials/anoncreds-credentials Perform an HTTP GET request to the documentation URL with an `ask` query parameter to get dynamic answers and relevant excerpts. The question should be specific and self-contained. ```http GET https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/credentials/anoncreds-credentials.md?ask= ``` -------------------------------- ### Instantiate Email Client in JS Source: https://docs.sudoplatform.com/guides/email/integrate-the-email-sdk Initialize the Email client in your application by configuring the SDK and providing necessary client instances. Ensure prerequisites are met. ```typescript import { DefaultApiClientManager } from '@sudoplatform/sudo-api-client' import { DefaultConfigurationManager } from '@sudoplatform/sudo-common' import { DefaultSudoEmailClient } from '@sudoplatform/sudo-email' import { DefaultSudoProfilesClient } from '@sudoplatform/sudo-profiles' import { DefaultSudoUserClient } from '@sudoplatform/sudo-user' const sdkConfigJSON = /* ... refer to Users documentation ... */ DefaultConfigurationManager.getInstance().setConfig(sdkConfigJSON) const userClient = new DefaultSudoUserClient(/* refer to Users documentation */) const profilesClient = new DefaultSudoProfilesClient(/* refer to Sudos documentation */) const apiClientManager = DefaultApiClientManager.getInstance().setAuthClient(userClient) const emailClient = new SudoEmailClient( apiClientManager userClient, profilesClient, ) ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/connections To get information not directly on this page, perform an HTTP GET request to the page URL with an `ask` query parameter. The question should be specific and in natural language. ```http GET https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/connections.md?ask= ``` -------------------------------- ### Retrieve User Entitlements with SDKs Source: https://docs.sudoplatform.com/guides/entitlements/administrative-api/managing-user-entitlements Examples of how to retrieve a user's entitlements and consumption data using the Sudo Platform SDKs. Handle potential errors during the operation. ```swift do { let userEntitlementsConsumption = try await client.getEntitlementsForUserWithExternalId( externalId: externalId ) } catch { // Handle error. An error may be thrown if the backend is unable perform // the operation due to invalid input, availability or security issues. } ``` ```kotlin val userEntitlementsConsumption = client.getEntitlementsForUser( externalId, ) ``` ```typescript const input = { externalId, } const userEntitlementsConsumption = await client.getEntitlementsForUser(input) ``` -------------------------------- ### Initialize SudoEntitlementsAdminClient in Swift Source: https://docs.sudoplatform.com/guides/entitlements/administrative-api/integrating-the-administrative-api Initialize the DefaultSudoEntitlementsAdminClient in your Swift application by providing the API key. Ensure the API key is securely managed. ```swift let client = try DefaultSudoEntitlementsAdminClient(apiKey: apiKey) ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/audit-logs To get information not directly on this page, make an HTTP GET request to the current page URL with the `ask` query parameter. The question should be specific and self-contained. ```http GET https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/audit-logs.md?ask= ``` -------------------------------- ### Instantiate SudoVirtualCardsClient in Kotlin Source: https://docs.sudoplatform.com/guides/virtual-cards/integrate-the-virtual-cards-sdk Initialize the `SudoVirtualCardsClient` by providing the application context and pre-initialized Sudo User and Sudo Profiles clients. Ensure you have followed the setup instructions for the User and Sudo SDKs. ```kotlin val userClient = // ... see "Users" docs val profilesClient = // ... see "Sudos" docs val virtualCardsClient = SudoVirtualCardsClient.builder() .setContext(appContext) .setSudoUserClient(userClient) .setSudoProfilesClient(profilesClient) .build() ``` -------------------------------- ### Query Documentation with `ask` Parameter Source: https://docs.sudoplatform.com/guides/password-manager/integrate-the-password-manager-sdk Perform an HTTP GET request on the current page URL with the `ask` query parameter to get specific information. The question should be self-contained and in natural language. ```HTTP GET https://docs.sudoplatform.com/guides/password-manager/integrate-the-password-manager-sdk.md?ask= ``` -------------------------------- ### List Entitlement Definitions with Next Token (Swift) Source: https://docs.sudoplatform.com/guides/entitlements/administrative-api/entitlement-definitions Demonstrates how to list entitlement definitions using the Swift SDK, handling pagination with a next token and potential errors. ```swift do { let listOutput = try await client.listEntitlementDefinitionsWithNextToken( limit: 50, nextToken: nil, ) } catch { // Handle error. An error may be thrown if the backend is unable perform // the operation due to invalid input, availability or security issues. } ``` -------------------------------- ### Initialize SudoEntitlementsAdminClient in Kotlin Source: https://docs.sudoplatform.com/guides/entitlements/administrative-api/integrating-the-administrative-api Initialize the SudoEntitlementsAdminClient in your Android application using the builder pattern, providing the application context and API key. The build() method finalizes the client creation. ```kotlin val client = SudoEntitlementsAdminClient.builder( appContext, apiKey ).build() ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.sudoplatform.com/guides/email/manage-email-folders To get additional information not directly available on the page, perform an HTTP GET request to the page URL with the `ask` query parameter. The question should be specific and self-contained. ```HTTP GET https://docs.sudoplatform.com/guides/email/manage-email-folders.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.sudoplatform.com/guides/email/email-masks To get more information not present on the current page, make an HTTP GET request to the page URL with the `ask` query parameter. The question should be specific and in natural language. ```http GET https://docs.sudoplatform.com/guides/email/email-masks.md?ask= ``` -------------------------------- ### Instantiate Email Client in Swift (iOS) Source: https://docs.sudoplatform.com/guides/email/integrate-the-email-sdk Initialize the Email client in your iOS application using Swift Package Manager. Ensure you have the necessary user client instance and configuration. ```swift import SudoEmail import SudoUser let userClient = // ... see "Users" docs let emailClient = try DefaultSudoEmailClient( keyNameSpace: "MyNameSpace", sudoUserClient: userClient ) ``` -------------------------------- ### List All Transactions for a User (Kotlin) Source: https://docs.sudoplatform.com/guides/virtual-cards/manage-transactions Retrieve transactions for a user's virtual cards in Kotlin. This example demonstrates fetching transactions with optional parameters like limit, date range, and sort order. It handles success, partial, and error states, including pagination. ```kotlin launch { try { val result = withContext(Dispatchers.IO) { virtualCardsClient.listTransactions( limit = 20, nextToken = null, dateRange = null, sortOrder = SortOrder.DESC ) } when (result) { is ListAPIResult.Success -> { // [result.items] contains the list of items matching the input. // Page through the results if [output.nextToken] != null. } is ListAPIResult.Partial -> { // [result.items] contains the list of items matching the input that decrypted successfully. // [result.failed] contains the list of items that failed decryption with associated error. // Page through the results if [partial.nextToken] != null. } } } catch (e: TransactionException) { // Handle/notify user of exception } } ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/relay-sdk/relay-entitlements To get more information not present on the page, make an HTTP GET request to the current page URL with the `ask` query parameter. The question should be specific and in natural language. ```http GET https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/relay-sdk/relay-entitlements.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/edge-agent-sdk Perform an HTTP GET request to the current page URL with the `ask` query parameter to dynamically query the documentation. The question should be specific and self-contained. ```http GET https://docs.sudoplatform.com/guides/decentralized-identity/decentralized-identity/edge-agent-sdk.md?ask= ```