New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

toolbox-devvit

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toolbox-devvit

Helpers for working with /r/toolbox data from Devvit community apps.

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

toolbox-devvit npm version

Helpers for working with /r/toolbox data from Devvit community apps. Read the documentation.

Installation

npm install --production toolbox-devvit

Usage Example

import {Devvit} from '@devvit/public-api';
import {ToolboxClient} from 'toolbox-devvit';

Devvit.configure({
	redditAPI: true,
	// ...
});

// A simple action that creates a usernote on a post's author
Devvit.addMenuItem({
	location: 'post',
	label: 'Create Test Usernote',
	description: 'Creates a Toolbox usernote for testing',
	onPress: async (event, {reddit, ui, postId}) => {
		const subredditName = (await reddit.getCurrentSubreddit()).name;
		const username = (await reddit.getPostById(postId!)).authorName;
		const text = 'Hihi i am a note';
		const wikiRevisionReason = 'Create note via my custom app';

		const toolbox = new ToolboxClient(reddit);
		await toolbox.addUsernote(subredditName, {
			username,
			text,
		}, wikiRevisionReason);

		ui.showToast({
			appearance: 'success',
			text: 'Note added!',
		});
	},
});

export default Devvit;

License

MIT © the toolbox team

FAQs

Package last updated on 31 Oct 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