Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getpara.com/llms.txt

Use this file to discover all available pages before exploring further.

The Para Server SDK enables secure server-side blockchain operations across different JavaScript runtime environments. With nearly identical functionality to client-side implementations, the server SDK allows you to perform signing operations server-side by either importing client-side sessions or using pregenerated wallets.

Installation

Install the Para Server SDK in your preferred JavaScript runtime environment:
npm install @getpara/server-sdk --save-exact
Why --save-exact? The Para Server SDK may publish breaking changes in minor versions during active development. Pinning the exact version prevents unexpected breakage when you install or update dependencies.

Initialization

Initialize the Para Server SDK with your API key. The initialization process varies slightly depending on your runtime environment:
import { Para as ParaServer } from "@getpara/server-sdk";

// Standard initialization for Node.js 
const paraServer = new ParaServer("YOUR_API_KEY");

Runtime Compatibility

The Server SDK works across multiple JavaScript runtimes. Some runtimes require additional constructor options:
RuntimedisableWebSocketsNotes
Node.jsNot neededFull support out of the box
BunRequiredBun’s WebSocket implementation is incompatible with the SDK’s internal transport
DenoRequiredSame as Bun — the SDK falls back to HTTP polling
Cloudflare WorkersRequiredWorkers runtime doesn’t support persistent WebSocket connections
If you omit disableWebSockets: true in Bun, Deno, or Cloudflare Workers, the SDK may fail silently or hang during signing operations. Always set this option for non-Node.js runtimes.
Signing performance tip: Para’s signing infrastructure runs in us-east-1. For the lowest latency on server-side signing operations, deploy your application servers in or near that region.
If you’re using a legacy API key (one without an environment prefix) you must provide the Environment as the first argument to the ParaServer constructor. You can retrieve your updated API key from the Para Developer Portal at https://developer.getpara.com/
Pre-warm the MPC signer: The first signing operation loads the MPC WASM module and spawns a worker thread, which adds latency. Call initializeWorker() after setup to pre-warm the signer so subsequent signing calls are fast:
const paraServer = new ParaServer("YOUR_API_KEY");
await paraServer.initializeWorker();

Authentication Methods

After initializing the Para Server SDK, you need to authenticate it before performing any operations. The server SDK supports two authentication methods:

Option 1: Importing Client Sessions

Import an active session from your client application when your backend needs to act for an authenticated user. In your client application, export the authenticated session and send it to your backend:
const serializedSession = await para.waitAndExportSession();

await fetch("/api/import-session", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ session: serializedSession }),
});
waitAndExportSession() waits for the SDK to reach an authenticated state before exporting. Use it for client-to-server handoff flows immediately after login.
If the server does not need to sign for the user, export without signer data:
const sessionWithoutSigners = await para.waitAndExportSession({
  excludeSigners: true,
});
Do not use { excludeSigners: true } when the server needs to sign messages or transactions for the user.
On your server, import the serialized session into a new ParaServer instance:
import { Para as ParaServer } from "@getpara/server-sdk";

app.post("/api/import-session", async (req, res) => {
  const paraServer = new ParaServer("YOUR_API_KEY");
  await paraServer.importSession(req.body.session);

  const isActive = await paraServer.isSessionActive();
  return res.status(200).json({ isActive });
});
With a session loaded into the server instance, you can perform the operations that the Para Server SDK supports.
Create a new ParaServer instance for each imported user session. A server SDK instance holds one active session at a time.

Option 2: Using Pregenerated Wallets

Generate and use deterministic wallets server-side without requiring client-side authentication. This pregen wallet will load the para server instance with a wallet that can be used for all operations that the Para Server SDK supports.
import { WalletType } from "@getpara/server-sdk";

await paraServer.createPregenWallet({
  type: 'EVM', // or 'SOLANA', 'COSMOS', 'STELLAR'
  pregenId: { email: "user@example.com" },
});
When using pregenerated wallets, you’ll need to manage the user share of the wallet and store it securely.
Learn more about pregen wallets and their usage on the server in our pregen wallets guide.

Examples

Explore our example implementations of the Para Server SDK across different runtime environments:

Troubleshooting

If you encounter issues while setting up the Para Server SDK, check out our troubleshooting guide:

Next Steps

Once your Para Server SDK is set up and authenticated, you can start performing blockchain operations. The server SDK provides the same functionality as the client SDK, allowing you to: