VVERSE/OS
VVerseOS Docs

VerseOS JavaScript / TypeScript SDK Quickstart

The VerseOS SDK is split into two security domains:

Browser
  @verseos/solana
  wallet signs payment
       ↓ signature
Your server
  @verseos/sdk
  vos_live_... API key
       ↓
VerseOS /v1

Never expose a VerseOS API key in browser code.

Current release candidate: @verseos/sdk v0.1.1 and @verseos/solana v0.1.1. The packages are currently packaged locally rather than published to npm.

1. Install the server SDK

After building and packing the SDK workspace, install the generated tarball into your server project:

npm install C:\path\to\verseos-sdk-0.1.1.tgz

2. Create a VerseOS client

import { VerseOS } from '@verseos/sdk';

const verseos = new VerseOS({
  apiKey: process.env.VERSEOS_API_KEY!,
  baseUrl: 'http://localhost:3000',
});

Set your test API key in PowerShell:

$env:VERSEOS_API_KEY = "vos_live_YOUR_TEST_KEY"

3. Discover assets

const assets = await verseos.assets.list({
  verification_status: 'verified',
  licensable: true,
});

console.dir(assets, { depth: null });

Useful discovery methods:

await verseos.assets.list({
  type: 'character',
  verification_status: 'verified',
  licensable: true,
});

await verseos.rights.list({
  medium: 'game',
  max_price_usdc: 1000,
});

4. Read one asset's rights

const offers = await verseos.assets.rights(
  'VRS-C9A739A09131'
);

Or inspect one right directly:

const right = await verseos.rights.get(
  'RGT-794B30A19A22'
);

5. Create a license intent

const intent = await verseos.licenses.createIntent(
  'RGT-794B30A19A22'
);

console.dir(intent, { depth: null });

The current standard checkout returns exact creator/platform split information. Keep any returned token base-unit values as strings.

6. Pay in the browser

Install the browser-side helper package generated from the SDK workspace:

npm install C:\path\to\verseos-solana-0.1.1.tgz

Then use the connected wallet signer and your existing Solana client:

import { payLicenseIntent } from '@verseos/solana';

const payment = await payLicenseIntent({
  client,
  signer: connectedWallet.signer,
  usdcMint: process.env.NEXT_PUBLIC_USDC_MINT!,
  intent,
});

console.log(payment.signature);

@verseos/solana:

  • constructs the creator transfer;
  • constructs the VerseOS platform-fee transfer;
  • creates recipient ATAs if needed;
  • submits the transaction through the connected wallet;
  • returns the Solana signature;
  • does not contain a VerseOS API key;
  • does not independently issue the VerseOS license.

7. Verify payment on your server

Send the signature back to your server, then call:

const result = await verseos.payments.verify({
  signature: payment.signature,
  licenseIntentId: intent.public_id,
});

console.dir(result, { depth: null });

VerseOS independently verifies the Solana transaction and issues LIC-... only after the expected USDC transfers are confirmed.

8. Retrieve the license

const license = await verseos.licenses.get(
  result.license.public_id
);

Verification record

const record = await verseos.verify.record(
  'VRS-C9A739A09131'
);

This can expose evidence hashes, provenance attestations, and available rights.

Supported server SDK methods

SDK methodEndpoint
verseos.assets.list()GET /v1/assets
verseos.assets.get(id)GET /v1/assets/:id
verseos.assets.create(input)POST /v1/assets
verseos.assets.rights(id)GET /v1/assets/:id/rights
verseos.rights.list()GET /v1/rights
verseos.rights.get(id)GET /v1/rights/:id
verseos.licenses.createIntent(rightId)POST /v1/license-intents
verseos.licenses.get(id)GET /v1/licenses/:id
verseos.payments.verify(input)POST /v1/payments/verify
verseos.verify.record(id)GET /v1/verify/:id

Private-beta warning

The server SDK methods above have been exercised successfully against the local Developer API. The separate @verseos/solana browser payment helper should still receive one dedicated end-to-end browser test before VerseOS calls the entire standard external checkout path production-ready.