{"templateId":"markdown","versions":[{"version":"v1.44","label":"v1.44 STS","link":"/pt-br/products/custody/get-started/integrate-via-sdk","default":true,"active":false,"folderId":"714bb270"},{"version":"v1.43","label":"v1.43 LTS","link":"/pt-br/products/custody/v1.43/get-started/integrate-via-sdk","default":false,"active":true,"folderId":"714bb270"},{"version":"v1.42","label":"v1.42 STS","link":"/pt-br/products/custody/v1.42/get-started/integrate-via-sdk","default":false,"active":false,"folderId":"714bb270"},{"version":"v1.34","label":"v1.34 LTS","link":"/pt-br/products/custody/v1.34/get-started/integrate-via-sdk","default":false,"active":false,"folderId":"714bb270"},{"version":"v1.26","label":"v1.26 LTS","link":"/pt-br/products/custody/v1.26/get-started/integrate-via-sdk","default":false,"active":false,"folderId":"714bb270"},{"version":"v1.19","label":"v1.19 LTS","link":"/pt-br/products/custody/v1.19/get-started/integrate-via-sdk","default":false,"active":false,"folderId":"714bb270"},{"version":"v1.15","label":"v1.15 LTS","link":"/pt-br/products/custody/v1.15/get-started/integrate-via-sdk","default":false,"active":false,"folderId":"714bb270"}],"sharedDataIds":{"sidebar":"sidebar-@l10n/pt-BR/products/custody/@v1.15/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition","tabs","tab"]},"type":"markdown"},"seo":{"title":"Integrate via SDK","description":"User guides, API reference, and support resources.","siteUrl":"https://docs.ripple.com","lang":"en-US"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"integrate-via-sdk","__idx":0},"children":["Integrate via SDK"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ripple Custody (Vault)"," provides client SDKs that wrap the REST API. This quickstart takes you from installing an SDK to submitting your first intent. Use it when you're starting a new integration in TypeScript, Java, or Python."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each SDK handles authentication, intent signing and submission, response-signature verification, and pagination. Your code calls typed methods instead of sending raw HTTP requests."]},{"$$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":{"data-label":"SDK"},"children":["SDK"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Package"},"children":["Package"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Runtime"},"children":["Runtime"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["TypeScript"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@ripple/ripple-custody-client-lib-typescript"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Node.js 22.19 or later. Promise-based API."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Java"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["com.ripple.custody.platform.contrib:ripple-custody-client-lib-java"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Java 17 or later. Synchronous API."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Python"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ripple_custody_client_lib_python"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Python 3.9 or later. Synchronous and asynchronous clients."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a feature comparison and the full reference, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks"},"children":["Client SDKs"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Pre-release versions"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDKs are pre-1.0. Their APIs may change between releases. Pin the exact version that you test with."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before you start, you must have:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Access to a running ","Ripple Custody (Vault)"," instance, including its API base URL and the URL of its OpenID Connect (OIDC) issuer."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A registered user with a P-256 signing key pair. You keep the private key in a PEM file, and the platform holds the public key. To create and register the key pair, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/identity-and-access/authentication/generate-api-keys-and-register"},"children":["Generate a key pair and register a public key"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The user ID and domain ID of that registered user."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The notary API public key for your environment. By default, the SDKs verify the signature on API responses, and they require this key to do so. Get the key from your ","Ripple Custody (Vault)"," administrator."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-the-sdk","__idx":2},"children":["Install the SDK"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ripple provides the SDK packages as files. To get the package for your language, contact the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/support/get-support"},"children":["Ripple support team"]},". Then install the SDK from the file."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["File names include the SDK version. In the following commands, replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{version}"]}," with the version that you received."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"TypeScript","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the package from the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".tgz"]}," file:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install ./ripple-ripple-custody-client-lib-typescript-{version}.tgz\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["npm records the dependency in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["package.json"]}," as a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["file:"]}," path. Keep the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".tgz"]}," file where your build can reach it, for example in your repository."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To sign with AWS Key Management Service (KMS) or Azure Key Vault instead of a local key file, also install the provider SDK. The TypeScript SDK loads it on demand:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install @aws-sdk/client-kms                     # AWS KMS\nnpm install @azure/keyvault-keys @azure/identity    # Azure Key Vault\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the JAR and its Project Object Model (POM) file into your local Maven repository. The POM lists the SDK's dependencies, so your build tool resolves them from Maven Central:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"mvn install:install-file \\\n  -Dfile=ripple-custody-client-lib-java-{version}.jar \\\n  -DpomFile=ripple-custody-client-lib-java-{version}.pom\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then add the dependency to your build. For Gradle:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"groovy","header":{"controls":{"copy":{}}},"source":"repositories {\n    mavenLocal()\n    mavenCentral()\n}\n\ndependencies {\n    implementation 'com.ripple.custody.platform.contrib:ripple-custody-client-lib-java:{version}'\n}\n","lang":"groovy"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For Maven:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<dependency>\n    <groupId>com.ripple.custody.platform.contrib</groupId>\n    <artifactId>ripple-custody-client-lib-java</artifactId>\n    <version>{version}</version>\n</dependency>\n","lang":"xml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a shared build, such as a CI pipeline, publish the JAR and POM to your organization's Maven repository instead of to each machine's local repository."]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the package from the wheel file:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"pip install ./ripple_custody_client_lib_python-{version}-py3-none-any.whl\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Python SDK packages optional features as extras. To install an extra, add it to the file name. Install only the extras that you use:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"pip install \"./ripple_custody_client_lib_python-{version}-py3-none-any.whl[async]\"           # AsyncCustodyClient\npip install \"./ripple_custody_client_lib_python-{version}-py3-none-any.whl[kms-hashicorp]\"   # HashiCorp Vault Transit signing\npip install \"./ripple_custody_client_lib_python-{version}-py3-none-any.whl[kms-aws]\"         # AWS KMS signing (Python 3.10 or later)\npip install \"./ripple_custody_client_lib_python-{version}-py3-none-any.whl[kms-azure]\"       # Azure Key Vault signing\npip install \"./ripple_custody_client_lib_python-{version}-py3-none-any.whl[kms-all]\"         # All three KMS providers\npip install \"./ripple_custody_client_lib_python-{version}-py3-none-any.whl[evm]\"             # EVM contract-call encoding\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["pip installs the SDK's own dependencies from PyPI."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"use-the-command-line-helper","__idx":3},"children":["Use the command-line helper"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The TypeScript and Python packages install a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ripple-custody"]}," command. The Java SDK has no command-line helper."]},{"$$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":{"data-label":"Command"},"children":["Command"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"TypeScript"},"children":["TypeScript"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Python"},"children":["Python"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ripple-custody quickstart"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Prints the getting-started steps."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Creates a project directory with a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["config.toml"]},", a new signing key, and a runnable script."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ripple-custody keygen"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Generates a signing key pair. Choose the curve with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--curve"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["P-256"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["secp256k1"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Ed25519"]},") and write the private key to a file with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--out"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Generates a signing key pair. Choose the key type with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--key-type"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Secp256r1"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Secp256k1"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Ed25519"]},") and write the private key to a file with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--out"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ripple-custody config init"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Copies the configuration template to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["./config.toml"]},", or to the path you pass."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Writes an annotated ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["config.toml"]},", plus ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".envrc"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".gitignore"]}," stubs, to the current directory."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ripple-custody doctor"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Checks your configuration and connectivity to the cluster."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Checks your installation, configuration, and connectivity. Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--json"]}," for output you can attach to a support request."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["keygen"]}," commands print the public key in base64-encoded DER (SPKI) format. The platform expects this format when you register a key."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you installed the TypeScript SDK locally, run the command through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["npx"]},", for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["npx ripple-custody doctor"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configure-the-sdk","__idx":4},"children":["Configure the SDK"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All three SDKs read a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["config.toml"]}," file and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RC_*"]}," environment variables. An environment variable always overrides the matching value in the file. By default, each SDK looks for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["config.toml"]}," at the path in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RC_CONFIG_FILE"]},", then in the current working directory, then at ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["~/.config/ripple-custody/config.toml"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All three SDKs use the same key names, so the same file works in each language. Create a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["config.toml"]}," file like the following, and replace the placeholders with your instance's URLs, your IDs, and the notary API public key:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"toml","header":{"controls":{"copy":{}}},"source":"api_base_url          = \"https://<api-host>\"\noidc_issuer_url       = \"https://<auth-host>/realms/<realm>\"\nprivate_key_file      = \"/path/to/signing-key.pem\"\nrc_user_id            = \"<your-user-id>\"\nrc_domain_id          = \"<your-domain-id>\"\nnotary_api_public_key = \"<notary-api-public-key>\"\n","lang":"toml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Don't set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_id"]}," when you sign with a private key. The SDKs treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_id"]}," as half of a client-credentials pair, and the TypeScript and Python SDKs fail unless you also supply a client secret. All three SDKs reject keys in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["config.toml"]}," that they don't recognize."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you know the exact token endpoint, set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token_endpoint"]}," in place of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["oidc_issuer_url"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To configure the SDK from the environment only, set the matching environment variables instead. The variable names are the same in all three SDKs:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"export RC_API_BASE_URL=\"https://<api-host>\"\nexport RC_OIDC_ISSUER_URL=\"https://<auth-host>/realms/<realm>\"\nexport RC_PRIVATE_KEY_FILE=\"/path/to/signing-key.pem\"\nexport RC_USER_ID=\"<your-user-id>\"\nexport RC_DOMAIN_ID=\"<your-domain-id>\"\nexport RC_NOTARY_API_PUBLIC_KEY=\"<notary-api-public-key>\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"protect-secrets","__idx":5},"children":["Protect secrets"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the preceding examples, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["config.toml"]}," holds no secrets, so you can keep it in version control. Keep secrets out of the file:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Private key."]}," The SDK reads the key from the file path in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["private_key_file"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RC_PRIVATE_KEY_FILE"]},". The key itself never appears in the configuration. Restrict the key file's permissions so that only your application's user can read it. Both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["keygen"]}," commands write the file with mode ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0600"]},". For production, sign with a KMS instead of a local file. For more information, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/authentication-and-signing"},"children":["Authentication and signing"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Client secret."]}," If you use the client-credentials grant, set the secret in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RC_CLIENT_SECRET"]}," environment variable. The Python SDK reads the secret only from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RC_CLIENT_SECRET"]},". The TypeScript SDK accepts ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]}," in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["config.toml"]}," but logs a warning when you set it there. The Java SDK rejects ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]}," in the file. Don't commit a file that holds the secret."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For every setting, including TLS and mutual TLS settings, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/configuration"},"children":["Configure the SDK"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-client","__idx":6},"children":["Create a client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Load the configuration and create a client. If the configuration is incomplete, this step fails immediately instead of on the first API call. For example, it fails if response verification is on and you haven't set a notary API public key."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following code loads ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["config.toml"]}," from the default location and creates a client:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"TypeScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import {\n  CustodyClient,\n  loadConfiguration,\n} from '@ripple/ripple-custody-client-lib-typescript';\n\nconst client = new CustodyClient(loadConfiguration());\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To load a file from another location, pass its path: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["loadConfiguration('/etc/custody/config.toml')"]},"."]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"import com.ripple.custody.CustodyClient;\nimport com.ripple.custody.CustodyClientConfig;\n\nCustodyClientConfig config = CustodyClientConfig.loadConfiguration();\nCustodyClient client = CustodyClient.fromConfig(config);\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CustodyClient.fromConfig"]}," reads the private key, chooses the OAuth grant, and builds the HTTP client for you. To load a file from another location, pass its path: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CustodyClientConfig.loadConfiguration(Path.of(\"/etc/custody/config.toml\"))"]},"."]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from ripple_custody_client_lib_python import CustodyClient, load_configuration\n\nconfig = load_configuration()\nclient = CustodyClient(config)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To load a file from another location, pass its path: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["load_configuration(\"/etc/custody/config.toml\")"]},"."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK obtains and refreshes OAuth access tokens for you."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"make-a-first-read-call","__idx":7},"children":["Make a first read call"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["List the domains that your user can see. A successful call confirms that authentication and response verification both work:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"TypeScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const page = await client.governance.domains.list({ limit: 5 });\nconst domains = Array.isArray(page) ? page : page.items;\nfor (const domain of domains) {\n  console.log(`${domain.data.id}: ${domain.data.alias}`);\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list()"]}," returns one page by default. Pass ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["autoPaginate: true"]}," to get every item as a flat array instead."]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"import com.ripple.custody.models.CoreTrustedDomainsCollection;\n\nCoreTrustedDomainsCollection domains = client.governance().domains().list(5, null);\ndomains.getItems().forEach(d ->\n    System.out.println(d.getData().getId() + \": \" + d.getData().getAlias()));\n","lang":"java"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"result = client.governance.domains.list(limit=5)\nfor domain in result.items or []:\n    print(f\"{domain.data.id}: {domain.data.alias}\")\n","lang":"python"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a complete program, see example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["00"]}," (getting started). To get the examples, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks#examples"},"children":["Examples"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"submit-a-first-intent","__idx":8},"children":["Submit a first intent"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You make changes in ","Ripple Custody (Vault)"," by submitting signed intents. The SDK builds the intent, signs it with your key, submits it, and returns a pending intent that you can wait on."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example proposes a new user with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["viewer"]}," role. Your user must have permission to create users in the domain. The new user generates their own key pair and gives you only the public key, in base64-encoded DER format. Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<new-user-public-key>"]}," with that key:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"TypeScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const pending = await client.governance.users.create(\n  'new-user@example.com',\n  '<new-user-public-key>',\n  ['viewer'],\n  { loginIds: [{ id: 'new-user@example.com', providerId: 'harmonize' }] },\n);\n\nawait pending.waitAccepted(30_000);   // timeout in milliseconds\nawait pending.waitExecuted(120_000);\nconsole.log(`Intent ${pending.intentId} executed`);\n","lang":"typescript"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"import com.ripple.custody.PendingIntent;\nimport com.ripple.custody.models.CoreLoginId;\nimport java.util.List;\nimport java.util.Map;\n\nPendingIntent pending = client.governance().users().create(\n    config.getDefaultDomainId(),\n    null,                                   // let the SDK generate the user ID\n    \"new-user@example.com\",\n    \"<new-user-public-key>\",\n    List.of(\"viewer\"),\n    List.of(new CoreLoginId().id(\"new-user@example.com\").providerId(\"harmonize\")),\n    Map.of());\n\npending.waitAccepted(30);                   // timeout in seconds\nvar intent = pending.waitExecuted(120);\nif (!\"Executed\".equals(String.valueOf(intent.getData().getState().getStatus()))) {\n    throw new IllegalStateException(\"Intent did not execute: \" + intent.getData().getState().getStatus());\n}\nSystem.out.println(\"Intent \" + pending.getIntentId() + \" executed\");\n","lang":"java"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"pending = client.governance.users.create(\n    alias=\"new-user@example.com\",\n    public_key=\"<new-user-public-key>\",\n    roles=[\"viewer\"],\n    login_ids=[{\"id\": \"new-user@example.com\", \"provider_id\": \"harmonize\"}],\n)\n\npending.wait_accepted(timeout=30)    # timeout in seconds\nintent = pending.wait_executed(timeout=120)\nif intent.data.state.status != \"Executed\":\n    raise RuntimeError(f\"Intent did not execute: {intent.data.state.status}\")\nprint(f\"Intent {pending.intent_id} executed\")\n","lang":"python"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The two waits track the two stages of an intent:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Wait accepted"]}," returns when the platform accepts the request and creates the intent."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Wait executed"]}," waits for a final intent state. An intent can execute after it collects the approvals its policy requires, or end in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Failed"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Rejected"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Expired"]},". In TypeScript, the wait fails unless the intent executed. In Java and Python, it returns the intent in whatever final state it reaches, so check the status before reporting success or starting a dependent operation. In all SDKs, the wait fails if the timeout expires."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a complete program, see example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["10"]}," (create user). To get the examples, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks#examples"},"children":["Examples"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For approvals, rejections, and transaction intents, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/intents"},"children":["Work with intents"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"close-the-client","__idx":9},"children":["Close the client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you're done, close the client to release its network connections:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"TypeScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"await client.close();\n","lang":"typescript"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Java client has no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["close()"]}," method and holds no resources that you need to release."]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"client.close()\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can also use the client as a context manager, which closes it for you:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"with CustodyClient(config) as client:\n    ...\n","lang":"python"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":10},"children":["Next steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks"},"children":["Client SDKs"]},": compare SDK features by language."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks#examples"},"children":["Examples"]},": get runnable example programs for common tasks."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks#agent-skills"},"children":["Agent skills"]},": help an AI coding assistant write code with the SDK."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/configuration"},"children":["Configure the SDK"]},": every configuration key and environment variable."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/authentication-and-signing"},"children":["Authentication and signing"]},": client credentials, key types, and KMS-backed signers."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/hashicorp-vault"},"children":["HashiCorp Vault"]},": sign with a Vault Transit key."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/intents"},"children":["Work with intents"]},": wait, approve, and reject intents."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/response-verification"},"children":["Response verification"]},": how the SDKs verify API responses."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/errors-and-http"},"children":["Errors and HTTP behavior"]},": exception types, timeouts, and retries."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/custody/v1.43/developer-experience/sdks/migrate-from-legacy-java-sdk"},"children":["Migrate from the legacy Java SDK"]},": move from the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["com.metaco"]}," SDK."]}]}]},"headings":[{"value":"Integrate via SDK","id":"integrate-via-sdk","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Install the SDK","id":"install-the-sdk","depth":2},{"value":"Use the command-line helper","id":"use-the-command-line-helper","depth":3},{"value":"Configure the SDK","id":"configure-the-sdk","depth":2},{"value":"Protect secrets","id":"protect-secrets","depth":3},{"value":"Create a client","id":"create-a-client","depth":2},{"value":"Make a first read call","id":"make-a-first-read-call","depth":2},{"value":"Submit a first intent","id":"submit-a-first-intent","depth":2},{"value":"Close the client","id":"close-the-client","depth":2},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"seo":{"title":"Integrate via SDK"}},"lastModified":"2026-10-23T09:06:20.000Z","isTranslationFallback":true,"pagePropGetterError":{"message":"","name":""}},"slug":"/pt-br/products/custody/v1.43/get-started/integrate-via-sdk","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}