You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Sign inDemoInstall


Package Overview
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies



A ️latency and sync speed optimized, developer friendly blockchain data indexer.

Version published



Envio CLI tool

A fast, reliable, customizable indexing blockchain solution.

Envio is a reliable real-time indexing solution designed to simplify the ingestion of events from EVM-compatible chains and transform this data into custom GraphQL APIs. These APIs play a pivotal role in enabling seamless user experiences in blockchain application front-ends. With Envio, the emphasis is on refining the developer's experience when using an indexer, ensuring the service is swift, secure, and trustworthy.

Note: For a thorough understanding and to dive deeper into each feature, refer to the original documentation website.

Table of Contents

Note: Envio is built for javascript, typescirpt and rescript. However in this readme we will only use typescript for examples. Refer to the documentation website for full docs.


For a slightly larger tutorial please see the Greeter contract tutorial.



To install the envio tool globally, run:

npm i -g envio

To view the available CLI commands:

envio --help


Important Commands Overview:

  • envio
  • envio init - Auto-generates configuration, GraphQL schema, and event handlers based on the Greeter template.
  • envio codegen - Generates code after setting configuration and schema files.
  • envio start - Start the indexer.
  • envio dev - Starts all the processes required for local development of the indexer.
  • envio stop - Delete the database and stop all processes

For a detailed breakdown of commands, refer to the documentation.

Event Handlers

After establishing the configuration and schema files, execute:

npx envio codegen

Custom code to make it easy to retrieve and process events from our contract is generated. More specifically every event necessitates the registration of two core functions from our generated code:

  • Loader function
  • Handler function

Loader Function

Loader functions are responsible for loading specific entities (defined in schema.graphql) to be modified by the event. They are called in the following format:

<ContractName>Contract_ < EventName > _loader;

NOTE: the syntax is slightly different for javascript and rescript. See loader docs.

Handler Function

Handler functions modify the entities loaded by the loader function. They incorporate the essential logic for updating entities with the raw data produced by the event. They're called as:

<ContractName>Contract_ < EventName > _handler;

NOTE: the syntax is slightly different for javascript and rescript. See handler docs.

For a comprehensive guide on Event Handlers, please refer to the provided documentation.


Logging is integral for tracking the progress and debugging issues in the indexer. Envio utilizes the pino logging library, which can be integrated with tools like kibana to extract metrics and insights.

For user-level logging, context-based functions are provided:

  • <context>.log.debug
  • <context>
  • <context>.log.warn
  • <context>.log.error
  • <context>.log.errorWithExn

Further details about developer logging, including log levels, can be found in the documentation.

Contribution & Support

🔧 This product under active development. Please always refer to the main documentation for the latest updates.

For support and updates, follow Envio on Twitter or join the Discord community.

If you have specific suggestions or requirements, kindly reach out and contribute to the development of Envio.

Our common issues page may also have useful help for you



Package last updated on 17 Jul 2024

Did you know?


Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.


Related posts

SocketSocket SOC 2 Logo


  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog


Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc