This guide covers authentication, identity creation, claim attestation, and querying identities & claims in TypeScript. By the end, you'll grasp the core functionalities and be ready for advanced examples.
- Node.js: Ensure Node.js (v16.14.0 or newer) is installed. Update if using an older version.
-
Clone the Repository:
git clone [email protected]:0xIntuition/speedrun-examples.git
-
Install Dependencies:
npm install # or yarn install # or pnpm install
-
Environment Configuration: Create a
.env
file and set the following:API_KEY=YOUR_API_KEY PRIVATE_KEY=0xYOUR_PRIVATE_KEY API_URL=https://api.intuition.cafe
API_KEY
: Essential for all API requests.PRIVATE_KEY
: Linked to the API key wallet, used for message signing and Ceramic Network writes. Append 0x to the start of your private key.API_URL
: Optional. Set tohttps://api.intuition.cafe
by default.
Note: This is a private key, not a seed phrase.
First, replace the subject_display_name
and subject_description
variables in src/speedrun.ts
in the main function with your own values. These will be used to create an identity and claim.
Next, replace the object_display_name
and object_description
variables in src/speedrun.ts
in the main function with your own values. These will be used to create an identity and claim.
Execute the script to perform operations like DID session creation, identity and claim creation, and querying:
npm run start
# or
yarn start
# or
pnpm start
Steps:
- Fetch and sign a message for DID session creation.
- Exchange the signed message for a DID session.
- Create identities.
- Create a claim with the created identities
- Attest to the created claim.
- Query for identities.
- Query for claims by creator wallet address.
- Intuition Documentation: Dive into Intuition's core mechanics.
- Getting Started Guide: A concise API guide for claim creation, attestation, and querying.
- Contact Us: Connect with the Intuition team for help.