{"id":24988451,"url":"https://github.com/lit-protocol/js-sdk","last_synced_at":"2026-01-27T18:17:46.575Z","repository":{"id":64475651,"uuid":"526617419","full_name":"LIT-Protocol/js-sdk","owner":"LIT-Protocol","description":"The Lit Protocol SDK provides developers with a framework for implementing Lit functionality into their own applications.","archived":false,"fork":false,"pushed_at":"2025-05-09T00:03:16.000Z","size":94320,"stargazers_count":131,"open_issues_count":26,"forks_count":76,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-09T01:19:09.278Z","etag":null,"topics":["blockchain","bls-signatures","cosmosos","dapp","decentralized-applications","ecdsa","ethereum","javascript","lit-protocol","sdk","threshold-cryptography","typescript"],"latest_commit_sha":null,"homepage":"https://developer.litprotocol.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LIT-Protocol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"security.txt","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-08-19T13:24:40.000Z","updated_at":"2025-05-01T21:24:14.000Z","dependencies_parsed_at":"2023-09-21T19:19:35.864Z","dependency_job_id":"504b1dd5-0958-4573-a6b4-3e65de9c1cce","html_url":"https://github.com/LIT-Protocol/js-sdk","commit_stats":{"total_commits":2751,"total_committers":33,"mean_commits":83.36363636363636,"dds":0.6430388949472918,"last_synced_commit":"412264bb37ec586785d389fc9a9416f422b91c7f"},"previous_names":[],"tags_count":216,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIT-Protocol%2Fjs-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIT-Protocol%2Fjs-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIT-Protocol%2Fjs-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIT-Protocol%2Fjs-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LIT-Protocol","download_url":"https://codeload.github.com/LIT-Protocol/js-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259387,"owners_count":22040821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","bls-signatures","cosmosos","dapp","decentralized-applications","ecdsa","ethereum","javascript","lit-protocol","sdk","threshold-cryptography","typescript"],"created_at":"2025-02-04T12:04:20.497Z","updated_at":"2025-10-06T21:16:41.573Z","avatar_url":"https://github.com/LIT-Protocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eLit Protocol Javascript/Typescript SDK V7.x.x\u003c/h1\u003e\n\n\u003cimg src=\"https://i.ibb.co/p2xfzK1/Screenshot-2022-11-15-at-09-56-57.png\"\u003e\n\u003cbr/\u003e\n\u003ca href=\"https://twitter.com/LitProtocol\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/litprotocol?label=Follow\u0026style=social\"/\u003e\u003c/a\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\nThe Lit JavaScript SDK provides developers with a framework for implementing Lit functionality into their own applications. Find installation instructions in the docs to get started with the Lit SDK based on your use case:\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n\u003ca href=\"https://developer.litprotocol.com/v3/sdk/installation\"\u003e\u003cimg src=\"https://i.ibb.co/fDqdXLq/button-go-to-docs.png\" /\u003e\u003c/a\u003e\n\n\u003ca href=\"https://developer.litprotocol.com/v3/sdk/installation\"\u003e\nhttps://developer.litprotocol.com/SDK/Explanation/installation\n\u003c/a\u003e\n\n\u003c/div\u003e\n\n\u003cdiv align=\"left\"\u003e\n\n# Quick Start\n\n### NodeJS Exclusive\n\nRemoved browser-specific methods, e.g., checkAndSignAuthSig\n\n```\nyarn add @lit-protocol/lit-node-client-nodejs\n```\n\nor..\n\n### Isomorphic Implementation\n\nOperable in both Node.js and the browser\n\n```\nyarn add @lit-protocol/lit-node-client\n```\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# Packages\n\n📝 If you're looking to use the Lit SDK, you're probably all set with just the lit-node-client \u003clink\u003e. \u003cbr/\u003eGet started with interacting with Lit network!\n\n\u003c!-- autogen:package:start --\u003e\n\n| Package                                                                                                                    | Category                                                                                        | Download                                                                                                                                                                        |\n| -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [@lit-protocol/lit-node-client-nodejs](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/lit-node-client-nodejs) | ![lit-node-client-nodejs](https://img.shields.io/badge/-nodejs-2E8B57 'lit-node-client-nodejs') | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/lit-node-client-nodejs\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/lit-node-client-nodejs\"/\u003e\u003c/a\u003e |\n| [@lit-protocol/lit-node-client](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/lit-node-client)               | ![lit-node-client](https://img.shields.io/badge/-universal-8A6496 'lit-node-client')            | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/lit-node-client\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/lit-node-client\"/\u003e\u003c/a\u003e               |\n\nIf you're a tech-savvy user and wish to utilize only specific submodules that our main module relies upon, you can find individual packages listed below. This way, you can import only the necessary packages that cater to your specific use case::\n\n| Package                                                                                                                          | Category                                                                                                 | Download                                                                                                                                                                              |\n| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [@lit-protocol/access-control-conditions](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/access-control-conditions) | ![access-control-conditions](https://img.shields.io/badge/-universal-8A6496 'access-control-conditions') | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/access-control-conditions\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/access-control-conditions\"/\u003e\u003c/a\u003e |\n| [@lit-protocol/auth-helpers](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/auth-helpers)                           | ![auth-helpers](https://img.shields.io/badge/-universal-8A6496 'auth-helpers')                           | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/auth-helpers\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/auth-helpers\"/\u003e\u003c/a\u003e                           |\n| [@lit-protocol/constants](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/constants)                                 | ![constants](https://img.shields.io/badge/-universal-8A6496 'constants')                                 | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/constants\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/constants\"/\u003e\u003c/a\u003e                                 |\n| [@lit-protocol/contracts-sdk](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/contracts-sdk)                         | ![contracts-sdk](https://img.shields.io/badge/-universal-8A6496 'contracts-sdk')                         | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/contracts-sdk\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/contracts-sdk\"/\u003e\u003c/a\u003e                         |\n| [@lit-protocol/core](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/core)                                           | ![core](https://img.shields.io/badge/-universal-8A6496 'core')                                           | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/core\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/core\"/\u003e\u003c/a\u003e                                           |\n| [@lit-protocol/crypto](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/crypto)                                       | ![crypto](https://img.shields.io/badge/-universal-8A6496 'crypto')                                       | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/crypto\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/crypto\"/\u003e\u003c/a\u003e                                       |\n| [@lit-protocol/encryption](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/encryption)                               | ![encryption](https://img.shields.io/badge/-universal-8A6496 'encryption')                               | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/encryption\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/encryption\"/\u003e\u003c/a\u003e                               |\n| [@lit-protocol/event-listener](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/event-listener)                       | ![event-listener](https://img.shields.io/badge/-universal-8A6496 'event-listener')                       | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/event-listener\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/event-listener\"/\u003e\u003c/a\u003e                       |\n| [@lit-protocol/logger](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/logger)                                       | ![logger](https://img.shields.io/badge/-universal-8A6496 'logger')                                       | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/logger\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/logger\"/\u003e\u003c/a\u003e                                       |\n| [@lit-protocol/misc](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/misc)                                           | ![misc](https://img.shields.io/badge/-universal-8A6496 'misc')                                           | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/misc\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/misc\"/\u003e\u003c/a\u003e                                           |\n| [@lit-protocol/nacl](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/nacl)                                           | ![nacl](https://img.shields.io/badge/-universal-8A6496 'nacl')                                           | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/nacl\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/nacl\"/\u003e\u003c/a\u003e                                           |\n| [@lit-protocol/pkp-base](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-base)                                   | ![pkp-base](https://img.shields.io/badge/-universal-8A6496 'pkp-base')                                   | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/pkp-base\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/pkp-base\"/\u003e\u003c/a\u003e                                   |\n| [@lit-protocol/pkp-cosmos](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-cosmos)                               | ![pkp-cosmos](https://img.shields.io/badge/-universal-8A6496 'pkp-cosmos')                               | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/pkp-cosmos\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/pkp-cosmos\"/\u003e\u003c/a\u003e                               |\n| [@lit-protocol/pkp-ethers](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-ethers)                               | ![pkp-ethers](https://img.shields.io/badge/-universal-8A6496 'pkp-ethers')                               | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/pkp-ethers\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/pkp-ethers\"/\u003e\u003c/a\u003e                               |\n| [@lit-protocol/pkp-sui](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-sui)                                     | ![pkp-sui](https://img.shields.io/badge/-universal-8A6496 'pkp-sui')                                     | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/pkp-sui\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/pkp-sui\"/\u003e\u003c/a\u003e                                     |\n| [@lit-protocol/pkp-walletconnect](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-walletconnect)                 | ![pkp-walletconnect](https://img.shields.io/badge/-universal-8A6496 'pkp-walletconnect')                 | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/pkp-walletconnect\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/pkp-walletconnect\"/\u003e\u003c/a\u003e                 |\n| [@lit-protocol/types](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/types)                                         | ![types](https://img.shields.io/badge/-universal-8A6496 'types')                                         | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/types\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/types\"/\u003e\u003c/a\u003e                                         |\n| [@lit-protocol/uint8arrays](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/uint8arrays)                             | ![uint8arrays](https://img.shields.io/badge/-universal-8A6496 'uint8arrays')                             | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/uint8arrays\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/uint8arrays\"/\u003e\u003c/a\u003e                             |\n| [@lit-protocol/wasm](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/wasm)                                           | ![wasm](https://img.shields.io/badge/-universal-8A6496 'wasm')                                           | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/wasm\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/wasm\"/\u003e\u003c/a\u003e                                           |\n| [@lit-protocol/wrapped-keys](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/wrapped-keys)                           | ![wrapped-keys](https://img.shields.io/badge/-universal-8A6496 'wrapped-keys')                           | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/wrapped-keys\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/wrapped-keys\"/\u003e\u003c/a\u003e                           |\n| [@lit-protocol/wrapped-keys-lit-actions](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/wrapped-keys-lit-actions)   | ![wrapped-keys-lit-actions](https://img.shields.io/badge/-universal-8A6496 'wrapped-keys-lit-actions')   | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/wrapped-keys-lit-actions\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/wrapped-keys-lit-actions\"/\u003e\u003c/a\u003e   |\n| [@lit-protocol/auth-browser](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/auth-browser)                           | ![auth-browser](https://img.shields.io/badge/-browser-E98869 'auth-browser')                             | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/auth-browser\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/auth-browser\"/\u003e\u003c/a\u003e                           |\n| [@lit-protocol/misc-browser](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/misc-browser)                           | ![misc-browser](https://img.shields.io/badge/-browser-E98869 'misc-browser')                             | \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@lit-protocol/misc-browser\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lit-protocol/misc-browser\"/\u003e\u003c/a\u003e                           |\n\n\u003c!-- autogen:package:end --\u003e\n\n## API Doc\n\n| Version      | Link                                                     |\n| ------------ | -------------------------------------------------------- |\n| V7 (Current) | [7.x.x docs](https://v7-api-doc-lit-js-sdk.vercel.app/)  |\n| V6           | [6.x.x docs](https://v6-api-doc-lit-js-sdk.vercel.app/)  |\n| V5           | [5.x.x docs](https://v3.api-docs.getlit.dev/)            |\n| V2           | [2.x.x docs](http://docs.lit-js-sdk-v2.litprotocol.com/) |\n\n\u003c/div\u003e\n\n# Contributing and developing to this SDK\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- Node.js v19.0.0 or later\n- Rust v1.70.0 or later\n- [wasm-pack](https://github.com/rustwasm/wasm-pack) for WebAssembly compilation\n\n## Development Tools\n\nRecommended for better development experience:\n\n- [NX Console](https://nx.dev/core-features/integrate-with-editors) - Visual Studio Code extension for NX workspace management\n\n# Quick Start\n\nTo start developing with this repository:\n\n1. Install dependencies:\n\n```\nyarn\n```\n\n2. Build the packages:\n\n```\nyarn build:dev\n```\n\n## Building\n\nBuild the project using one of these commands:\n\n```\n// For local development (optimized, excludes production-only operations)\nyarn build:dev\n\n// For testing and publishing (full build with all operations)\nyarn build\n```\n\n## Run unit tests\n\n```\nyarn test:unit\n```\n\n## Run E2E tests in nodejs\n\n```\nyarn test:local\n```\n\n# Advanced\n\n## Creating a new library\n\n`nx generate @nx/js:library`\n\n## Building\n\n```sh\nyarn build\n```\n\n### Building target package\n\n```sh\nyarn nx run \u003cproject-name\u003e:build\n```\n\n## Building Local Changes\n\nDuring development you may wish to build your code changes in `packages/` in a client application to test the correctness of the functionality.\n\nIf you would like to establish a dependency between packages within this monorepo and an external client application that consumes these packages:\n\n1. Run `npm link` at the root of the specific package you are making code changes in.\n\n```\ncd ./packages/*/\u003cpackage-name\u003e\nnpm link\n```\n\n2. Build the packages with or without dependencies\n\n```\nyarn build\n# or\nyarn nx run lit-node-client-nodejs:build --with-deps=false\n```\n\n3. In the client application, run `npm link \u003cpackage\u003e --save` to ensure that the `package.json` of the client application is updated with a `file:` link to the dependency. This effectively creates a symlink in the `node_modules` of the client application to the local dependency in this repository.\n\n```\ncd path/to/client-application\nnpm link \u003cpackage\u003e --save\n```\n\nHaving done this setup, this is what the development cycle looks like moving forward:\n\n1. Make code change\n2. Rebuild specific package\n3. Rebuild client application.\n\n### Building Rust Components\n\nFor changes to WebAssembly components in `packages/wasm`, refer to the [WebAssembly build guide](./packages/wasm/README.md).\n\n## Publishing New Versions\n\nPrerequisites:\n\n- Node.js v18.0.0 or later\n\nPublishing steps:\n\n1. Create a release PR:\n\n   - Create a new branch from master with format `vX.X.X-Publish`\n   - Add changelog as PR description\n   - Add \"Release\" label to the PR\n   - Reference example: https://github.com/LIT-Protocol/js-sdk/pull/753\n\n2. After PR approval, proceed with publishing:\n   - Update dependencies: `yarn install`\n   - Increment version: `yarn bump`\n   - Build packages: `yarn build`\n   - Run tests:\n     - Unit tests: `yarn test:unit`\n     - E2E tests: `yarn test:local`\n   - Generate documentation: `yarn gen:docs --push`\n   - Publish packages: `yarn publish:packages`\n   - Commit with message: \"Published version X.X.X\"\n\n## Testing Guide\n\n### Available Test Commands\n\n| Command           | Description                          |\n| ----------------- | ------------------------------------ |\n| `yarn test:unit`  | Run unit tests for all packages      |\n| `yarn test:local` | Run E2E tests in Node.js environment |\n\n### Running Tests\n\n1. Unit Tests:\n\n   ```sh\n   yarn test:unit\n   ```\n\n2. End-to-End Tests:\n\n   ```sh\n   yarn test:local\n   ```\n\n   Optional Environment Variables:\n\n   - NETWORK=\u003cnetwork_name\u003e (datil, datil-test, datil-dev, etc.)\n   - DEBUG=true/false\n\n   Optional Flags:\n\n   - --filter=\u003ctest-name\u003e\n\n   See more in `local-tests/README.md`\n\n## Local Development with Lit Node\n\n### Setup Local Environment\n\n1. Deploy Lit Node Contracts (addresses will be read from `../lit-assets/blockchain/contracts/deployed-lit-node-contracts-temp.json`)\n\n2. Configure environment variables:\n\n```sh\n# Enable local node development\nexport LIT_JS_SDK_LOCAL_NODE_DEV=\"true\"\n\n# Set funded wallet for Chronicle testnet\nexport LIT_JS_SDK_FUNDED_WALLET_PRIVATE_KEY=\"your-funded-private-key\"\n```\n\n## Environment Variables\n\n| Variable                               | Description                 | Usage                                                        |\n| -------------------------------------- | --------------------------- | ------------------------------------------------------------ |\n| `LIT_JS_SDK_GITHUB_ACCESS_TOKEN`       | GitHub access token         | Required for accessing contract ABIs from private repository |\n| `LIT_JS_SDK_LOCAL_NODE_DEV`            | Local node development flag | Set to `true` to use a local Lit node                        |\n| `LIT_JS_SDK_FUNDED_WALLET_PRIVATE_KEY` | Funded wallet private key   | Required for Chronicle Testnet transactions                  |\n\n# Error Handling Guide\n\n## Overview\n\nThe SDK implements a robust error handling system using [@openagenda/verror](https://github.com/OpenAgenda/verror). This system provides:\n\n- Detailed error information with cause tracking\n- Error composition and chaining\n- Additional context through metadata\n- Compatibility with native JavaScript Error handling\n\n## Using Error Handling\n\n### Basic Example\n\n```ts\nimport { VError } from '@openagenda/verror';\nimport { LitNodeClientBadConfigError } from '@lit-protocol/constants';\n\ntry {\n  // Simulate an error condition\n  const someNativeError = new Error('some native error');\n\n  // Throw a Lit-specific error with context\n  throw new LitNodeClientBadConfigError(\n    {\n      cause: someNativeError,\n      info: { foo: 'bar' },\n      meta: { baz: 'qux' },\n    },\n    'some useful message'\n  );\n} catch (e) {\n  // Access error details\n  console.log(e.name); // LitNodeClientBadConfigError\n  console.log(e.message); // some useful message: some native error\n  console.log(e.info); // { foo: 'bar' }\n  console.log(e.baz); // qux\n\n  // Additional error information\n  // - VError.cause(e): Original error (someNativeError)\n  // - VError.info(e): Additional context ({ foo: 'bar' })\n  // - VError.meta(e): Metadata ({ baz: 'qux', code: 'lit_node_client_bad_config_error', kind: 'Config' })\n  // - VError.fullStack(e): Complete error chain stack trace\n}\n```\n\n## Creating Custom Errors\n\nTo add new error types:\n\n1. Locate `packages/constants/src/lib/errors.ts`\n2. Add your error definition to the `LIT_ERROR` object\n3. Export the new error class\n4. Import and use in your code with relevant context:\n   ```ts\n   throw new YourCustomError(\n     {\n       cause: originalError,\n       info: {\n         /* context */\n       },\n       meta: {\n         /* metadata */\n       },\n     },\n     'Error message'\n   );\n   ```\n\n# Dockerfile\n\n...coming soon\n\n## Other Commands\n\n# Core Systems and Services\n\nThe Lit Protocol SDK provides the following core systems:\n\n- Cryptographic key management (PKP - Programmable Key Pair)\n- Blockchain wallet interactions (Ethereum, Solana, Cosmos)\n- Decentralized authentication and authorization\n- Distributed computing and signing\n- Smart contract management\n- Access control and encryption services\n\n# Main Functions and Classes\n\nKey components available across packages:\n\n- `PKPEthersWallet`: Ethereum wallet management for PKP\n- `LitNodeClient`: Network interaction client\n- `executeJs()`: Decentralized JavaScript execution\n- `signMessageWithEncryptedKey()`: Cryptographic signing\n- `generatePrivateKey()`: Key generation utilities\n- `TinnyEnvironment`: Testing environment setup\n\n# Troubleshooting Guide\n\n## Common Issues and Solutions\n\n### Crypto API Error\n\n**Problem:** \"Reference Error: crypto is not defined\"\n\n**Solution:**\nAdd the following polyfill for environments without native crypto:\n\n```js\nimport crypto, { createHash } from 'crypto';\n\n// Add crypto to global scope\nObject.defineProperty(globalThis, 'crypto', {\n  value: {\n    // Implement getRandomValues\n    getRandomValues: (arr: any) =\u003e crypto.randomBytes(arr.length),\n\n    // Implement subtle crypto\n    subtle: {\n      digest: (algorithm: string, data: Uint8Array) =\u003e {\n        return new Promise((resolve) =\u003e\n          resolve(\n            createHash(algorithm.toLowerCase().replace('-', ''))\n              .update(data)\n              .digest()\n          )\n        );\n      },\n    },\n  },\n});\n```\n\n### Unexpected Error on Node\n\n**Problem:** Exit code 13\n\n**Solution:**\nMake sure your node version is above v18.0.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flit-protocol%2Fjs-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flit-protocol%2Fjs-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flit-protocol%2Fjs-sdk/lists"}