Overview

The Para Server SDK enables secure server-side signing by importing client-side sessions, ideal for automated transaction signing and server-side wallet operations. The server SDK provides nearly identical functionality to client-side implementations, allowing seamless transition between environments.

You can also use the Server SDK with pre-generated wallets if your use case requires wallet creation to occur server-side. To do this, follow the steps outlined in the Pre-generated Wallet Integration Guideand import the @getpara/server-sdk package in your server-side environment instead of the relevant client side package.

Installation

Usage

When you need to perform signing operations server-side, you can export an active session from your client application and import it into a server-side Para instance. This creates a server-side replica of your client-side wallet that can perform the same operations.

1

Export Client Session

In your client application, export the active session to get a serialized string:

// Client-side
const serializedSession = await para.exportSession();
// Send this string to your server endpoint
2

Initialize Server SDK

On your server, initialize the Para Server SDK:

// Server-side route
import { Para as ParaServer, Environment } from "@getpara/server-sdk";

const paraServer = new ParaServer(Environment.BETA, API_KEY);

3

Import Session

Import the serialized session to create a functional server-side client:

// Server-side
await paraServer.importSession(serializedSession);
4

Perform Operations

Use the server-side instance just like a client-side one:

// Direct signing
const signature = await paraServer.signMessage(walletId, messageToSign);

// With ethers.js import { ParaEthersSigner } from "@getpara/ethers-v6-integration";

const ethersSigner = new ParaEthersSigner(paraServer, provider); const signature = await
ethersSigner.signMessage(messageToSign);

Implement secure session transfer between client and server. The server can only perform signing while the imported session remains valid.

Examples

Explore our example implementation of the Server SDK:

Best Practices

  • Keep imported sessions secure and ephemeral
  • Implement proper error handling for invalid sessions
  • Monitor signing operations for security
  • Regularly refresh sessions to maintain functionality