0.0.1 • Published 11 months ago

@curatedotfun/near-social v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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";

// Create an instance of the plugin
const nearSocialPlugin = new NearSocialPlugin();

// Initialize the plugin with your NEAR account credentials
await nearSocialPlugin.initialize({
  accountId: "your-account.near",
  privateKey: "your-private-key",
  networkId: "mainnet" // or "testnet"
});

// Distribute content to NEAR Social
await nearSocialPlugin.distribute({
  input: "Hello, NEAR Social! This is a post from Curated.fun."
});

Configuration

The plugin requires the following configuration:

ParameterTypeRequiredDescription
accountIdstringYesYour NEAR account ID (e.g., "example.near")
privateKeystringYesYour NEAR account private key
networkId"mainnet" | "testnet"NoThe 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

# Install dependencies
npm install

# Build the plugin
npm run build

# Run tests
npm test

License

MIT