Okto Docs

Template Repository

A comprehensive walkthrough of the Okto Express Template App designed for Okto APIs. This Express app demonstrates how to interact with the Okto 3pBFF through API calls, including authentication, explorer, and intents.

Demo Only

Note that this app is for demonstration purposes only and is not meant for production application. Be sure to customize and secure it before using in production.

API Express Template Repository

Route Implementations

This template app demonstrates the implementation of the following route handlers:

Okto API Express Template Postman Collection

Download and import the Okto API Express Postman Collection for easy access and testing of all endpoints and methods.

API Routes

Each of these route files demonstrates how to interact with the Okto backend for their respective API categories.

Auth Routes (/api/auth)

MethodPathDescription
POST/email/otpRequest OTP for email
POST/email/verify-otpVerify OTP for email
POST/whatsapp/otpRequest OTP for WhatsApp
POST/whatsapp/verify-otpVerify OTP for WhatsApp
POST/authenticateAuthenticate user

Explorer Routes (/api/explorer)

MethodPathDescription
GET/accountGet account details
GET/chainsGet supported chains
GET/tokensGet supported tokens
GET/portfolioGet portfolio summary
GET/portfolio-activityGet portfolio activity
GET/portfolio-nftGet portfolio NFTs
GET/order-historyGet order history
POST/read-contract-dataRead data from a smart contract

Intent Routes (/api/intent)

MethodPathDescription
POST/tokenTransferInitiate a token transfer intent
POST/rawTransactionInitiate a raw transaction intent
POST/tokenTransfer/estimateEstimate a token transfer intent
POST/rawTransaction/estimateEstimate a raw transaction intent
POST/tokenTransfer/executeAfterEstimateExecute token transfer after estimation
POST/rawTransaction/executeAfterEstimateExecute raw transaction after estimation

Getting Started

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

  1. Clone the repository:
git clone https://github.com/okto-hq/okto-sdkv2-express-template-app.git
  1. Change into the project directory and install dependencies:
cd okto-sdkv2-express-template-app
npm install
  1. Set up environment variables:
cp .env.sample .env
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. Run the application:
npm run dev