Node backend
Use Swivy from your server. Verify logins, manage wallets, submit intents and configure each network's RPC.
Preview: Swivy is not generally available
Swivy is in staging. It is not in production and Swop's own apps don't run on it yet. The SDK packages aren't published to npm; preview partners get access along with their credentials. Everything on this page can change. Request early access.
Use @swivy/node when your server needs to finish a login, read the signed-in user, create wallets, submit intents, configure networks or hand an AI agent a session grant.
1. Install and configure
npm install @swivy/nodeSWIVY_BASE_URL=https://YOUR_SWIVY_BASE_URL
SWIVY_APP_ID=app_...
SWIVY_SECRET_KEY=sk_swivy_...
SWIVY_CONTROL_PLANE_KEY=sak_swivy_... # only for admin tasks: projects, environments, chains, webhooksKeep server keys on the server
SWIVY_SECRET_KEY and SWIVY_CONTROL_PLANE_KEY must never reach a browser or a mobile app. Browsers and phones use the publishable key.
import { SwivyNodeClient } from '@swivy/node';
export const swivy = new SwivyNodeClient({
baseUrl: process.env.SWIVY_BASE_URL!,
appId: process.env.SWIVY_APP_ID!,
secretKey: process.env.SWIVY_SECRET_KEY!,
controlPlaneKey: process.env.SWIVY_CONTROL_PLANE_KEY,
});2. Finish a login
export async function finishLogin(email: string, code: string) {
const login = await swivy.verifyEmailCode(email, code);
const me = await swivy.getMe();
return { sessionToken: login.sessionToken, user: me.user, wallets: me.managedAccounts };
}The client keeps the session token in memory. If you already have one, call swivy.setSessionToken(token).
3. Create or load a wallet
const { account } = await swivy.ensureEmbeddedWallet('evm', { label: 'Primary wallet' });Chain families are 'evm' and 'solana'.
4. Submit a transaction intent
const intent = await swivy.createTransactionIntentAndWait({
accountId: account.id,
chain: 'evm',
challengeId, // from the user's passkey step-up, when policy requires it
payload: {
network: 'base-sepolia',
transaction: { to: '0x1111111111111111111111111111111111111111', value: '0x0', data: '0x' },
},
});5. Point each network at an RPC
await swivy.upsertEnvironmentChainRpcConfig('env_...', 'evm', {
network: 'base-mainnet',
rpcUrl: 'https://YOUR_BASE_RPC',
});
await swivy.upsertEnvironmentChainRpcConfig('env_...', 'solana', {
network: 'solana-mainnet',
rpcUrl: 'https://YOUR_SOLANA_RPC',
commitment: 'confirmed',
});You can point these at Swop RPC project URLs.
6. Manage admin keys
Rotate to narrower, organization-scoped keys after setup:
const created = await swivy.createOrganizationAdminCredential('org_...', { label: 'Ops admin', role: 'admin' });
await swivy.listOrganizationAdminCredentials('org_...');
await swivy.revokeOrganizationAdminCredential('org_...', 'orgkey_...');Swivy won't let you remove the last active owner key of an organization.
Export and raw signing
exportManagedAccount and rawSign exist for hybrid-custody escape hatches. Both need a step-up challenge and are off unless your environment policy allows them. Prefer intents.