Start Developing

To interact with the Keeta Network, we’ve built the KeetaNet SDK — a JavaScript and TypeScript-compatible library that works in multiple environments, including Node.js, modern web browsers, and other JavaScript runtimes.

Whether you're building server-side applications or browser-based dApps, the SDK gives you everything you need to connect to the Keeta Network, manage accounts, send transactions, and more.

Installation and Type Support

The SDK includes full TypeScript definitions, so you’ll get autocomplete and inline type checking in modern editors. You can install it from npm:

npm install @keetanetwork/keetanet-client

Type definitions are bundled with the package — no need to install anything extra.

Using the SDK in NodeJS

In Node.js, you can import the KeetaNet SDK like this:

import * as KeetaNet from '@keetanetwork/keetanet-client';

Once imported, the SDK exposes several modules and utilities. The most important starting point is the UserClient, which lets you connect to the network and perform operations like sending tokens or fetching blockchain data.

const signer = KeetaNet.lib.Account.fromSeed(mySeed, 0);
const client = KeetaNet.UserClient.fromNetwork('test', signer);

Using the SDK in the Browser

You can also use the KeetaNet SDK directly in a browser using a script tag. Here's a basic example to get started:

<html>
  <head>
    <script src="https://static.test.keeta.com/keetanet-browser.js"></script>
  </head>
  <body>
    <script>
      // Generate a random seed
      const seed = KeetaNet.lib.Account.generateRandomSeed({ asString: true });

      // Create an account from the seed
      const account = KeetaNet.lib.Account.fromSeed(seed, 0);

      // Connect to the test network
      const client = KeetaNet.UserClient.fromNetwork('test', account);

      // Fetch and log some chain info
      client.chain().then(console.debug);
    </script>
  </body>
</html>

This is a good way to get started quickly without any build tools. Just keep in mind: don’t store or expose real private keys or seeds in client-side code in production apps.

Last updated