@nekofar/warpcast
Version:
TypeScript client for interacting with Warpcast APIs
86 lines (59 loc) • 2.51 kB
Markdown
# Warpcast
[](https://github.com/nekofar/warpcast/releases)
[](https://github.com/nekofar/warpcast/actions/workflows/build.yml)
[](https://github.com/nekofar/warpcast/blob/master/LICENSE)
[](https://x.com/nekofar)
[](https://warpcast.com/nekofar)
[](https://ud.me/nekofar.crypto)
> [!IMPORTANT]
> This repo is for **educational and experimental use only**. It uses **non-public APIs** and may **violate Warpcast policies**.
> **Not recommended for production or consumer products**. Use at your own risk.
> [!IMPORTANT]
> This project is currently **under development** and considered **unstable**. Significant changes may occur, and
> functionality is not guaranteed at this stage.
## Usage
Install the package using your preferred package manager:
```bash
npm install @nekofar/warpcast
```
### Basic Setup
First, import and configure the client with your API credentials:
```typescript
import { client } from '@nekofar/warpcast';
client.setConfig({
baseUrl: 'https://api.warpcast.com',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
});
```
### Fetching User Data
Retrieve user information by username:
```typescript
import { getUserByUsername } from '@nekofar/warpcast';
const user = await getUserByUsername({
query: { username: 'nekofar' }
});
console.log(user.data); // User profile information
```
### Getting Feed Items
Fetch items from a user's feed:
```typescript
import { getFeedItems } from '@nekofar/warpcast';
const feed = await getFeedItems({
query: { feedType: 'following', limit: 25 }
});
console.log(feed.data); // Array of feed items
```
### Creating Casts
Post a new cast to Warpcast:
```typescript
import { createCast } from '@nekofar/warpcast';
const cast = await createCast({
body: {
text: 'Hello Warpcast!',
embeds: []
}
});
console.log(cast.data); // Created cast details
```