Skip to main content

Function

createPkpSessionSigs(params)
Issues fresh session signatures for a PKP based on pre-generated delegation materials. Pair this with createPkpAuthContextFromPreGenerated when a backend needs to sign or execute Lit Actions on demand.

Parameters

params.authContext
AuthContext
required
Auth context obtained from createPkpAuthContextFromPreGenerated or createPkpAuthContext.
params.litClient
LitClient
required
Lit client that will request session signatures from the network.
params.product
'DECRYPTION' | 'SIGN' | 'LIT_ACTION' | 'SIGN_SESSION_KEY'
Optional override for the product type when you need signatures for a specific capability. Defaults to LIT_ACTION.

Returns

sessionSigs
SessionSigsMap
Session signatures scoped to the delegated resources.

Example

import {
  createPkpAuthContextFromPreGenerated,
  createPkpSessionSigs,
} from '@lit-protocol/auth';

const authContext = await createPkpAuthContextFromPreGenerated({
  pkpPublicKey,
  sessionKeyPair,
  delegationAuthSig,
});

const pkpSessionSigs = await createPkpSessionSigs({
  authContext,
  litClient,
});