title | description |
---|---|
Integrate API |
Easily add intelligent features to your app |
Hypermode makes it easy to incrementally add intelligence your app.
You can find your project's API endpoint in the Hypermode Console, in your
project's Home tab, in the format https://<slug>.hypermode.app/<path>
.
Hypermode protects your project's endpoint with an API key. In your project dashboard, navigate to Settings → API Keys to find and manage your API tokens.
From your app, you can call the API by passing the API token in the
Authorization
header. Here's an example using the fetch
API in JavaScript:
const endpoint = "" // your API endpoint
const key = "" // your API key
// your graphql query
const query = `query {
...
}`
const response = await fetch(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: key,
},
body: JSON.stringify({
query: query,
}),
})
const data = await response.json()