Setup your code editor for Apibara indexers

Apibara indexers are powered by the Deno Javascript runtime. If you haven't used Deno before, you need to setup your environment to get the best possible developer experience for Apibara indexers.

Monorepo with Node, Bun and Deno

If you're using a monorepo you want to enable Deno only for your indexer's project. You do that by customizing your editor's LSP configuration.

Let's start with the following monorepo with two sub-projects: the frontend (for example Next.js) and the indexers.

.
├── apps
│   ├── frontend
│   │   ├── app
│   │   │   ├── layout.tsx
│   │   │   └── page.tsx
│   │   ├── package.json
│   │   └── tsconfig.json
│   └── indexers
│       ├── deno.json
│       └── src
│           └── my-indexer.ts
├── package.json
└── turbo.json

If you're using VS Code, you can enable Deno for the indexers project only by adding the following configuration to .vscode/settings.json.

.vscode/settings.json
{
  "deno.enable": true,
  "deno.lint": true,
  "deno.unstable": false,
  "deno.enablePaths": ["./apps/indexers"]
}

After that, you may have to restart the Deno LSP server and you will have autocompletion working in your indexers project.

Last modified
Apibara

Apibara is the fastest platform to build production-grade indexers that connect onchain data to web2 services.

© 2024 GNC Labs Limited. All rights reserved.