Quickstart

Get a working example running in minutes.

Option 1: Clone the Playground (Fastest)

The TrikHub Playground is a complete example project with LangGraph integration.

git clone https://github.com/Molefas/trikhub.git cd examples/js/local-playground npm install

Follow the instructions on README.md 

Option 2: Add to Existing Project

1. Install Dependencies

npm install @trikhub/cli -g npm install @trikhub/gateway @trikhub/manifest

2. Login and Install a Trik

trik login trik install @molefas/article-search

3. Load Triks in Your Code

import { loadLangChainTriks } from '@trikhub/gateway/langchain' // Load all installed triks as LangChain tools const { tools, gateway, loadedTriks } = await loadLangChainTriks() console.log(`Loaded: ${loadedTriks.join(', ')}`) // → Loaded: @molefas/article-search

4. Use with LangGraph

import { ChatOpenAI } from '@langchain/openai' const model = new ChatOpenAI({ model: 'gpt-4o-mini' }) const modelWithTools = model.bindTools(tools) // The agent now has access to the trik's actions const response = await modelWithTools.invoke([ { role: 'user', content: 'Search for AI articles' } ])

What Happens

  1. Agent calls the article-search trik
  2. Trik returns structured agentData (safe) + userContent (for display)
  3. Agent sees only safe data, makes decisions based on that
  4. User sees full content

Next Steps