{"id":49307041,"url":"https://github.com/dfinity/icp-js-signer","last_synced_at":"2026-04-26T10:02:20.929Z","repository":{"id":348696892,"uuid":"1193778541","full_name":"dfinity/icp-js-signer","owner":"dfinity","description":"Library to interact with ICRC-25 compliant signers on the Internet Computer.","archived":false,"fork":false,"pushed_at":"2026-04-10T09:34:02.000Z","size":322,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T11:28:39.594Z","etag":null,"topics":["authentication","icp","internet-computer","signers","typescript","wallets"],"latest_commit_sha":null,"homepage":"https://js.icp.build/signer","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfinity.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-27T15:15:17.000Z","updated_at":"2026-04-08T11:45:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dfinity/icp-js-signer","commit_stats":null,"previous_names":["dfinity/icp-js-signer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dfinity/icp-js-signer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Ficp-js-signer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Ficp-js-signer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Ficp-js-signer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Ficp-js-signer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfinity","download_url":"https://codeload.github.com/dfinity/icp-js-signer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Ficp-js-signer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32292958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["authentication","icp","internet-computer","signers","typescript","wallets"],"created_at":"2026-04-26T10:02:19.684Z","updated_at":"2026-04-26T10:02:20.923Z","avatar_url":"https://github.com/dfinity.png","language":"TypeScript","readme":"# @icp-sdk/signer\n\nLibrary to interact with [ICRC-25](https://github.com/dfinity/wg-identity-authentication/blob/main/topics/icrc_25_signer_interaction_standard.md) compliant signers on the Internet Computer.\n\n## What are signers?\n\nA signer is an application that holds private keys and can sign messages on behalf of a user. Each signer chooses which standards to implement, but they typically fall into two categories:\n\n- **Asset wallets** support accounts and canister calls — users approve transactions directly through the signer (e.g. [OISY](https://oisy.com), [Plug](https://plugwallet.ooo), [PrimeVault](https://primevault.com)).\n- **Authentication providers** support delegations — users grant a session key that can sign on their behalf for a limited time (e.g. [Internet Identity](https://id.ai)).\n\nSome signers support both (e.g. [NFID](https://nfid.one)). This library provides a unified interface to interact with all of them.\n\n## Installation\n\n```shell\nnpm install @icp-sdk/signer\n```\n\n## Import Paths\n\n- `@icp-sdk/signer` — `Signer` for standardized signer interaction\n- `@icp-sdk/signer/agent` — `SignerAgent` as a drop-in replacement for `HttpAgent`\n- `@icp-sdk/signer/web` — `PostMessageTransport` for web-based signers\n- `@icp-sdk/signer/extension` — `BrowserExtensionTransport` for browser extension signers\n\n## Connecting to a Signer\n\nTwo transport types are supported. Web-based signers (like OISY, NFID, Internet Identity) use a window opened to the signer's URL. Browser extensions (like Plug, PrimeVault) are discovered automatically.\n\n### Web\n\nThe [ICRC-29](https://github.com/dfinity/wg-identity-authentication/blob/main/topics/icrc_29_window_post_message_transport.md) post message transport communicates with signers that run as web applications. A window is opened to the signer's URL, and messages are exchanged via `postMessage`.\n\n```ts\nimport { Signer } from \"@icp-sdk/signer\";\nimport { PostMessageTransport } from \"@icp-sdk/signer/web\";\n\nconst transport = new PostMessageTransport({ url: SIGNER_URL });\nconst signer = new Signer({ transport });\n```\n\n### Extension\n\nThe [ICRC-94](https://github.com/dfinity/wg-identity-authentication/blob/main/topics/icrc_94_multi_injected_provider_discovery.md) transport communicates with signers installed as browser extensions. Extensions announce themselves and are discovered automatically.\n\n```ts\nimport { Signer } from \"@icp-sdk/signer\";\nimport { BrowserExtensionTransport } from \"@icp-sdk/signer/extension\";\n\n// Discover all installed extension signers\nconst providerDetails = await BrowserExtensionTransport.discover();\n\n// Let the user choose, then create a transport\nconst transport = new BrowserExtensionTransport({\n  providerDetail: providerDetails[0],\n});\nconst signer = new Signer({ transport });\n```\n\nOr connect directly by UUID if you know which extension to use:\n\n```ts\nconst transport = await BrowserExtensionTransport.findTransport({\n  uuid: EXTENSION_UUID,\n});\n```\n\n## Checking Capabilities\n\nSigners vary in what they support. Query the supported standards before making calls so you can handle unsupported features gracefully:\n\n```ts\nconst standards = await signer.getSupportedStandards();\n\n// signer.getAccounts() requires ICRC-27\nconst canGetAccounts = standards.some((s) =\u003e s.name === \"ICRC-27\");\n\n// signer.callCanister() requires ICRC-49\nconst canCallCanisters = standards.some((s) =\u003e s.name === \"ICRC-49\");\n\n// signer.requestDelegation() requires ICRC-34\nconst canDelegate = standards.some((s) =\u003e s.name === \"ICRC-34\");\n\n// Asset wallets need both accounts and canister calls\nconst isAssetWallet = canGetAccounts \u0026\u0026 canCallCanisters;\n\n// The returned standards also include token standards (e.g. ICRC-1 for\n// fungible tokens, ICRC-7 for NFTs), so you can check whether the\n// signer can manage a particular asset type.\nconst supportsFungibleTokens = standards.some((s) =\u003e s.name === \"ICRC-1\");\n```\n\n## Transactions\n\nAsset wallets allow users to approve transactions. Use `SignerAgent` as a drop-in replacement for `HttpAgent` — it routes canister calls through the signer for user approval.\n\n```ts\nimport { Signer } from \"@icp-sdk/signer\";\nimport { PostMessageTransport } from \"@icp-sdk/signer/web\";\nimport { SignerAgent } from \"@icp-sdk/signer/agent\";\n\n// Connect to an asset wallet\nconst transport = new PostMessageTransport({ url: \"https://oisy.com/sign\" });\nconst signer = new Signer({ transport });\n\n// Get the user's accounts — some asset wallets return multiple (e.g. NFID),\n// others only one (e.g. OISY).\n// Each account has an `owner` (Principal) and an optional `subaccount`.\nconst accounts = await signer.getAccounts();\nconst account = accounts[0]; // Let the user choose if there are multiple\n\n// Create an agent for the chosen account's principal.\n// The agent only needs the owner — the principal that controls the account\n// and on whose behalf canister calls are signed.\nconst agent = await SignerAgent.create({\n  signer,\n  account: account.owner,\n});\n\n// Use the agent with any canister library\nimport { IcrcLedgerCanister } from \"@icp-sdk/canisters/ledger/icrc\";\n\nconst icpLedger = IcrcLedgerCanister.create({\n  agent,\n  canisterId: ICP_LEDGER_CANISTER_ID,\n});\nawait icpLedger.transfer({\n  to: TARGET_ACCOUNT,\n  amount: 100_000_000n,\n});\n```\n\n## Authentication\n\nAuthentication providers issue delegations — temporary keys that can sign on behalf of the user. This is useful for session-based authentication where individual transaction approval is not needed.\n\n```ts\nimport { Signer } from \"@icp-sdk/signer\";\nimport { PostMessageTransport } from \"@icp-sdk/signer/web\";\nimport { ECDSAKeyIdentity, DelegationIdentity } from \"@icp-sdk/core/identity\";\nimport { HttpAgent } from \"@icp-sdk/core/agent\";\n\n// Connect to an authentication provider\nconst transport = new PostMessageTransport({ url: \"https://id.ai/authorize\" });\nconst signer = new Signer({ transport });\n\n// Create a session key and request a delegation\nconst sessionKey = await ECDSAKeyIdentity.generate();\nconst delegationChain = await signer.requestDelegation({\n  publicKey: sessionKey.getPublicKey().toDer(),\n});\n\n// Create a DelegationIdentity that can sign without further user interaction\nconst identity = DelegationIdentity.fromDelegation(sessionKey, delegationChain);\nconst agent = await HttpAgent.create({ identity });\n```\n\n## TypeScript\n\nThis package requires the `node16` (or later) [`moduleResolution`](https://www.typescriptlang.org/tsconfig#moduleResolution) strategy.\n\n## License\n\nThis project is licensed under the Apache-2.0 license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinity%2Ficp-js-signer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfinity%2Ficp-js-signer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinity%2Ficp-js-signer/lists"}