Template Repository

A comprehensive walkthrough of the Okto TS Template App designed for Okto APIs. This template demonstrates core Okto functionality—including authentication, wallet management, and blockchain interactions—so you can quickly get started building with Okto.

Customize Before Production

Please note that this template is for development and testing purposes only. Be sure to customize and secure it before using in production.

API Reference Template Repository

Below are the links to individual scripts available in the GitHub repository:

Authenticate Scripts

ScriptGitHub Link
Google OAuthView on GitHub
Email AuthenticateView on GitHub
WhatsApp AuthenticateView on GitHub
JWT AuthenticateView on GitHub
Delegated ActionsView on GitHub
Treasury WalletView on GitHub

Intent Scripts

ScriptGitHub Link
Token Transfer IntentView on GitHub
NFT Transfer IntentView on GitHub
Raw Transaction IntentView on GitHub
Swap IntentView on GitHub
Sign DataView on GitHub

Getting Started

Find detailed instructions on how to set up the template app locally:

  1. Clone the repository:
git clone https://github.com/okto-hq/okto-sdkv2-ts-template.git
  1. Change into the project directory and install dependencies:
cd okto-sdkv2-ts-template
npm install
  1. Set up environment variables:
cp .env.sample .env
  1. Add your API keys to the .env file:
.env
# The Okto environment "sandbox" or "production"
OKTO_ENVIRONMENT =
 
# Get the below values from Okto Developer Dashboard. Learn how here- https://docs.okto.tech/docs/developer-admin-dashboard
OKTO_CLIENT_PRIVATE_KEY =
OKTO_CLIENT_SWA =
 
 
#optional: only needed if using google authenticate
# For testing purposes, you can generate the id token from here
# - https://docs.okto.tech/docs/openapi/authenticate/google-oauth/get-token-id
# NOTE: The google ID token has a very short expiry. Please generate a new token just before running this code. You can check the expiry at jwt.io
GOOGLE_ID_TOKEN =
 
 
# when testing intents or using delegated access you will have to generate the okto auth token from session config
# For testing purposes, you can generate the okto auth token from our tool 'Session and Okto Auth Token Generator'
# - https://docs.okto.tech/tools
OKTO_AUTH_TOKEN =
Warning:Essential Setup Required
Show

Before you begin, set up your developer dashboard by making sure you have :

If you need help, reach out to us on our troubleshooting form and we will contact you.

  1. Execute the script you want to run:
tsx path/to/your/script.ts