Install and configure the Dialect TypeScript SDK for sending notifications from your Node.js and React applications
Get the Dialect TypeScript SDK installed and configured in your environment. This guide covers installation, client setup, authentication, and environment configuration.
If you registered via SDK: Your DIALECT_SDK_CREDENTIALS should already be set up from the registration process.If you registered via Dashboard: You need to extract the private key from the wallet you used to register and format it as DIALECT_SDK_CREDENTIALS. Your app is tied to the specific keypair used during registration:
Export from your wallet app: Open Phantom, Solflare, etc. → Settings → Export Private Key → Copy the private key
Convert to array format: Use a tool like this to convert base58 private key to JSON array format [170,23,...,300]
Set in environment: Add the array format to your .env file as DIALECT_SDK_CREDENTIALS
You must use the same wallet that was used to register your app. The app registration is tied to that specific keypair and cannot be changed to a different wallet.
Secure Your Credentials: Keep your DIALECT_SDK_CREDENTIALS secure. This is your app’s private key and should never be exposed in client-side code or committed to version control.
// For production deployment, update the environmentconst environment: DialectCloudEnvironment = "production"; // Change to "development" for testingconst dialectSolanaSdk = Dialect.sdk( { environment, }, SolanaSdkFactory.create({ // IMPORTANT: must set environment variable DIALECT_SDK_CREDENTIALS // to your dapp's Solana messaging wallet keypair e.g. [170,23, . . . ,300] wallet: NodeDialectSolanaWalletAdapter.create(), }));