The Modus SDK provides a set of APIs that allow you to interact with various databases and services in Modus apps written in . It’s designed to work seamlessly with the Modus platform, enabling you to build powerful applications with ease.

The Modus SDKs come in multiple languages, each following the conventions for that language, including its capabilities and limitations. While each SDK provides similar features, the APIs may differ slightly between languages. Be sure to refer to the documentation for the specific SDK you’re using.

Wherever possible, we’ve tried to keep the APIs consistent across languages. However, you may find differences in the APIs due to language-specific constraints.

If you have any questions or need help, please reach out to us via the #modus channel on the Hypermode Discord server.

Importing the APIs

The Modus AssemblyScript SDK organizes its APIs into namespaces based on their purpose. In your AssemblyScript code, you can import each namespace you’d like to use like this:

import { <namespace> } from "@hypermode/modus-sdk-as"

Available APIs

We’re constantly introducing new APIs through ongoing development with early users. Please open an issue if you have ideas on what would make Modus even more powerful for your next app!

The following namespaces are available. They’re grouped into categories below for your convenience. Click on a namespace to view more information about its APIs.

Client APIs

NamespacePurpose
httpProvides access to external HTTP endpoints, including REST APIs and other services
graphqlAllows you to securely call and fetch data from any GraphQL endpoint

Database APIs

NamespacePurpose
dgraphAccess and modify data in a Dgraph database
mysqlAccess and modify data in a MySQL database
neo4jAccess and modify data in a Neo4j database
postgresqlAccess and modify data in a PostgreSQL database

Inference APIs

NamespacePurpose
modelsInvoke AI models, including large language models, embedding models, and classification models

Storage APIs

NamespacePurpose
collectionsProvides integrated storage and vector search capabilities

System APIs

NamespacePurpose
consoleProvides logging, assertion, and timing functions
localtimeAllows you to access the user’s local time and time zone