Integrating into a Dapp

Template Repository

A ready-to-use example showcasing the Okto Eliza Plugin with complete setup instructions and customization options.

Okto Eliza Sample Agent

Getting Started

Get started quickly with our pre-configured example that demonstrates the Okto Eliza Plugin in action. This implementation includes authentication setup, basic Web3 operations, and example conversations.

Tip:What's Included
Show
  • Pre-configured Okto Plugin integration
  • Google OAuth authentication setup
  • Example AI agent implementation
  • Sample Web3 operations and commands
  • Basic conversation flows
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.

Prerequisites

Before running the sample application, ensure you have:

  • Node.js: v23+ (required) - Download
  • Package Manager: pnpm - Install Guide
  • Okto API Keys: You need your OKTO_CLIENT_PRIVATE_KEY and OKTO_CLIENT_SWA. Obtain these from the Okto Dashboard.
  • Google OAuth Credentials: Create OAuth 2.0 credentials in the Google Cloud Console.
  • LLM Provider: Access to OpenAI, Anthropic, or other supported providers.

Installation

Clone the repository and set up the initial project structure:

bash
# Clone the repository
git clone https://github.com/okto-hq/okto-sdk-eliza-agent-template
cd okto-eliza-ai-agent-example
 
# Install dependencies
pnpm install

Environment Setup

Copy the .env.sample file to .env:

bash
cp .env.sample .env

Edit .env with your credentials:

.env
# Okto specific settings
OKTO_ENVIRONMENT=                # Optional. Defaults to "sandbox". Options: sandbox, staging, production.
OKTO_CLIENT_PRIVATE_KEY=         # Required. Your client private key provided by Okto.
OKTO_CLIENT_SWA=                 # Required. Your client SWA provided by Okto.
 
# Google OAuth settings
GOOGLE_CLIENT_ID=                # Required. Get from https://console.cloud.google.com/
GOOGLE_CLIENT_SECRET=            # Required. Get from https://console.cloud.google.com/
 
# Note: You also need to set the environment variable for the LLM you want to use.

Get your OKTO_CLIENT_PRIVATE_KEY and OKTO_CLIENT_SWA from the Okto Dashboard.

Tip:Setting up Google OAuth
Show
  1. Go to Google Cloud Console
  2. Create OAuth 2.0 credentials for your project
  3. Set the redirect URI to: http://localhost:5000
  4. Save your Client ID and Client Secret in the .env file

Need detailed instructions? Check our Google Console Setup Guide.

Configuration

1. LLM Provider

By default, this sample agent uses Groq as the LLM model provider. To use a different provider:

  1. Open characters/okto.character.json
  2. Update the modelProvider field
  3. Add your provider's API key to .env
characters/okto.character.json
{
  "modelProvider": "groq", // Change to your preferred provider
  // ... other settings
}

Supported providers include OpenAI, Anthropic, and others compatible with Eliza.

2. Agent Character

The agent's personality, behavior, and capabilities are defined in characters/okto.character.json:

characters/okto.character.json
{
  "name": "Okto",
  "plugins": ["okto"],
  "system": "Okto is a helpful assistant that can help you perform blockchain network transactions.",
  "bio": [
    "Okto is a helpful assistant that can help you perform blockchain network transactions."
  ],
  "style": {
    "chat": [
      "be cool, don't act like an assistant",
      "be helpful when asked and be agreeable",
      "be warm and accommodate reasonable requests"
    ]
  },
  "topics": [
    "Blockchain",
    "Blockchain Transactions",
    "Blockchain Network"
  ]
}

You can modify these settings to adjust how your agent:

  • Responds to queries
  • Presents information
  • Handles transactions
  • Interacts with users

Launch

Start the application and begin testing:

bash
pnpm run start

Try these example commands to test the integration:

  • "Show me my wallet balance"
  • "What chains are supported?"
  • "Help me transfer some tokens"

Next Steps

Now that you have the sample agent running, you can:

Need help or have questions? Join our Discord community for support and discussions!

On this page