Server Setup
Install and configure the Para Server SDK across Node.js, Bun, and Deno environments
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:
Initialization
Initialize the Para Server SDK with your API key. The initialization process varies slightly depending on your runtime environment:
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 to create a server-side replica that can perform the same operations.
First, in your client application, export the active session to get a serialized string:
This serialiazed sessions tring can then be sent to your server via an API endpoint or any other secure method.
If signing on the server isnβt required, you can pass { excludeSigners: true }
as an argument to exportSession
to remove the signer data from the exported wallets:await para.exportSession({ excludeSigners: true });
before sending it to your server.
Then, on your server, import the serialized session to create a functional server-side client:
With a session no loaded into the para server instance, you can now perform all operations that the Para Server SDK supports.
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.
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: