Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

revolt-api

Package Overview
Dependencies
Maintainers
0
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

revolt-api

Revolt API Library

  • 0.7.16-next.2
  • beta
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
124
decreased by-36.08%
Maintainers
0
Weekly downloads
 
Created
Source

Revolt API

revolt-api

This package contains typings for objects in the Revolt API and a fully typed API request builder using openapi-fetch.

Example Usage

If you just need access to types:

import type { User } from "revolt-api";

If you want to send requests:

import { createClient } from "./esm/index.js";

const api = createClient({
  // specify bot token:
  botToken: "bot-token",
  // .. or a user session token:
  sessionToken: "session-token",
  // .. also accepts options from openapi-fetch
  //    such as custom middleware, baseURL, etc
});

// Fetch information about user
api.GET("/users/@me").then((res) => console.info(res.data));

// Send a message to a channel
api.POST("/channels/{target}/messages", {
  params: {
    path: {
      target: "01F92C5ZXBQWQ8KY7J8KY917NM",
    },
  },
  body: {
    content: "Hello from Fetch/Node.js/Bun/Deno!",
  },
});

FAQs

Package last updated on 07 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc