NEAR Social Plugin for Curated.fun
A distribution plugin for posting content to NEAR Social.
Installation
npm install @curatedotfun/near-social
Usage
import NearSocialPlugin from "@curatedotfun/near-social";
const nearSocialPlugin = new NearSocialPlugin();
await nearSocialPlugin.initialize({
accountId: "your-account.near",
privateKey: "your-private-key",
networkId: "mainnet"
});
await nearSocialPlugin.distribute({
input: "Hello, NEAR Social! This is a post from Curated.fun."
});
Configuration
The plugin requires the following configuration:
| accountId | string | Yes | Your NEAR account ID (e.g., "example.near") |
| privateKey | string | Yes | Your NEAR account private key |
| networkId | "mainnet" | "testnet" | No | The NEAR network to use (defaults to "mainnet") |
Security Considerations
- NEVER hardcode your private key in your application code.
- Use environment variables or a secure secret management system to store sensitive credentials.
- Consider using a dedicated NEAR account for posting to NEAR Social rather than your main account.
Features
- Post text content to NEAR Social
- Automatically formats and indexes posts for proper display on NEAR Social
- Supports both mainnet and testnet
Development
npm install
npm run build
npm test
License
MIT