🔑 Session Key Usage

Request Signing Permission

You can request permissions for function signing with the requestSigningPermission method:

const data = {
  privateKey: 'YOUR_NEW_PRIVATE_EPHEMERAL_KEY',
  permissions: [ /* permissions array */ ],
  id: 'YOUR_ID'
};
solaceConnect.requestSigningPermission(data).then((signers) => {
  console.log("Received signers: ", signers);
}).catch((err) => {
  console.error("Failed to request signing permission: ", err);
});

Attach Session

You can attach a session to the Solace Connect instance using the attachSession method:

solaceConnect.attachSession('YOUR_JWT_TOKEN');

Get Session Token

You can retrieve the current session token using the getSessionToken method:

solaceConnect.getSessionToken().then((sessionToken) => {
  console.log("Session token: " + sessionToken);
}).catch((err) => {
  console.error("Failed to get session token: ", err);
});

Get Solace Signer

You can retrieve a SolaceSigner instance using the getSolaceSigner method:

const ephemeralSigner = { /* your ephemeral signer object */ };
solaceConnect.getSolaceSigner(ephemeralSigner).then((signer) => {
  console.log("Received SolaceSigner: ", signer);
}).catch((err) => {
  console.error("Failed to get SolaceSigner: ", err);
});

Last updated