> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openformat.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Typescript

> Learn how to get set up, reward tokens, create badges, and reward badges with our TypeScript SDK.

<Steps>
  <Step title="Install">
    <CodeGroup>
      ```sh npm theme={null}
      npm install @openformat/sdk ethers@^5
      ```

      ```sh yarn theme={null}
      yarn add @openformat/sdk ethers@^5
      ```

      ```sh pnpm theme={null}
      pnpm add @openformat/sdk ethers@^5
      ```

      ```sh bun theme={null}
      bun add @openformat/sdk ethers@^5
      ```
    </CodeGroup>
  </Step>

  <Step title="Instantiate SDK">
    Before you can instantiate the SDK you need to [Create an Application](/getting-started/create-an-app).

    <CodeGroup>
      ```tsx Typescript theme={null}
      import { Chains, OpenFormatSDK } from "@openformat/sdk";

      const sdk = new OpenFormatSDK({
        network: Chains.arbitrumSepolia,
        appId: "YOUR_APP_ID",
        signer: process.env.PRIVATE_KEY, // Your wallet's private key
      });
      ```
    </CodeGroup>
  </Step>

  <Step title="Reward Token">
    <CodeGroup>
      ```tsx Typescript theme={null}
      import { ActivityType, RewardType, toWei } from "@openformat/sdk";

      const params = [
        {
          receiver: "0x821EFACF307Add10fd9A812624955cbEF943265c",
          id: "signed-up",
          address: "0x72092f038f94833f37cc197874ac8c9b02689ac1",
          amount: toWei("1"),
          actionType: RewardActionType.MINT,
          rewardType: RewardType.TOKEN,
          uri: "ipfs://metadata",
        },
      ];

      await sdk.Reward.trigger(params);
      ```
    </CodeGroup>
  </Step>

  <Step title="Create Badge">
    <CodeGroup>
      ```jsx Typescript theme={null}
      async function createBadge() {
        const params: Reward_CreateBadgeParams = {
          name: "My special Badge",
          symbol: "My special Badge",
        };

        const badge = await sdk.Reward.createBadge(params);
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Reward Badge">
    <CodeGroup>
      ```tsx Typescript theme={null}
      import { ActivityType, RewardType } from "@openformat/sdk";

      const params = [
        {
          receiver: "0x03755352654D73DA06756077Dd7f040ADcE3Fd58",
          id: "signed-up",
          address: "0x36db942d490f8091b91e020a8a934040ca426968",
          amount: 1,
          actionType: RewardActionType.MINT,
          rewardType: RewardType.BADGE,
          uri: "ipfs://metadata",
        },
      ];

      await sdk.Reward.trigger(params);
      ```
    </CodeGroup>
  </Step>
</Steps>
