setSessionToken (thinklumiere/sessionToken.ts)

lumiere · src/services/thinklumiere/sessionToken.ts · typescript · MIT
auth, tag:embed-classified

Securely stores, retrieves, and deletes ThinkLumiere session tokens across platforms.

// Source: https://github.com/ajamaica/lumiere | License: MIT | Copyright 2026 ajamaica
// Provided via justclaw.it.com; keep this notice with the code.
import { logger } from '../../utils/logger'
import { isWeb } from '../../utils/platform'

const SESSION_TOKEN_KEY = 'lumiere_session_token'
const log = logger.create('ThinkLumiereSession')

/**
 * Store the ThinkLumiere API session token securely.
 * Native: Expo SecureStore (Keychain/Keystore)
 * Web: encrypted via Web Crypto (AES-GCM) when a crypto key is available,
 *      falls back to localStorage if no password is configured.
 */
export async function setSessionToken(token: string): Promise<void> {
  if (isWeb) {
    try {
      const { getSessionCryptoKey } = await import('../../store/secureAtom')
      const { encryptAndStore } = a

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key