diff --git a/docs/developer-docs/developer-tools/off-chain/agents/javascript-agent.mdx b/docs/developer-docs/developer-tools/off-chain/agents/javascript-agent.mdx index fdce0bb14c..6112b0ba62 100644 --- a/docs/developer-docs/developer-tools/off-chain/agents/javascript-agent.mdx +++ b/docs/developer-docs/developer-tools/off-chain/agents/javascript-agent.mdx @@ -462,4 +462,4 @@ export const backend_canister = createActor(canisterId); - [`agent-js` documentation](https://agent-js.icp.xyz/agent/modules.html). -- [`agent-js` npm package](https://www.npmjs.com/package/@dfinity/agent). \ No newline at end of file +- [`agent-js` npm package](https://www.npmjs.com/package/@dfinity/agent). diff --git a/docs/developer-docs/developer-tools/off-chain/agents/nodejs.mdx b/docs/developer-docs/developer-tools/off-chain/agents/nodejs.mdx index dd6329f544..6f1726315b 100644 --- a/docs/developer-docs/developer-tools/off-chain/agents/nodejs.mdx +++ b/docs/developer-docs/developer-tools/off-chain/agents/nodejs.mdx @@ -16,7 +16,16 @@ import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow"; ## Identity management -Before you set up an actor, you will need to have an identity. You can set up an identity that will resolve a seed phrase to a principal by using the following code: +Before you set up an actor, you will need to have an identity. + +### Using keys through `agent-js` + +You can configure an authentication identity for Node.js through `agent-js`'s using the ECDSA or Ed25519 private keys. [Learn more in the agent-js docs](https://internetcomputer.org/docs/current/developer-docs/developer-tools/off-chain/agents/javascript-agent). + + +### Seed phrase + +Alternatively, you can set up an identity that will resolve a seed phrase to a principal by using the following code: ```js // identity.js @@ -35,7 +44,6 @@ The seed phrase in this example is derived from the word `test` repeated 12 time Remember to store any seed phrase you use in production in a secure place. Use environment variables, and never commit a real seed phrase in plain text to your codebase. ::: - ## Asset uploading A community library, `@dfinity/assets`, is available to upload assets to your project's asset canister. You'll need to get the canister ID, pass your agent, and then upload your files. Below is an example code snippet showcasing this workflow: @@ -359,4 +367,4 @@ main(); - [ic-websocket-js](https://www.npmjs.com/package/ic-websocket-js) -- [End to end testing](https://internetcomputer.org/docs/current/tutorials/developer-journey/level-2/2.5-unit-testing#end-to-end-e2e-testing) \ No newline at end of file +- [End to end testing](https://internetcomputer.org/docs/current/tutorials/developer-journey/level-2/2.5-unit-testing#end-to-end-e2e-testing)