Skip to content

Commit

Permalink
Merge pull request #197 from dimitrov-d/main
Browse files Browse the repository at this point in the history
Add RPC module SDK docs
  • Loading branch information
dimitrov-d authored Nov 21, 2024
2 parents 2b05a4f + 1cbba0e commit aa522f0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions build/5-apillon-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,42 @@ const { jobs: cloudFunctionJobs } = await cloudFunctions.cloudFunction(newCloudF
await cloudFunctionJobs[0].delete();
```

## RPCs

The RPC module provides functionalities for managing RPC API keys and listing available endpoints. This module is essential for interacting with the Apillon platform's RPC services dynamically.

### Usage example

```typescript
import { Rpc } from '@apillon/sdk';
import { getConfig } from './helpers/helper';

// Initialize the RPC module
const rpc = new Rpc({
key: 'yourApiKey',
secret: 'yourApiSecret',
});

// Create a new API key
const apiKey = await rpc.createApiKey({
name: 'Test API Key',
description: 'Test Description',
});
console.log('API Key created:', apiKey.name);

// List all API keys
const { items } = await rpc.listApiKeys();
console.log('Total API Keys:', items.length);

// Get a specific API key by ID
const apiKey = await rpc.apiKey(apiKeyId).get();
console.log('API Key UUID:', apiKey.uuid);

// List all available endpoints
const endpoints = await rpc.listEndpoints();
console.log('Total Endpoints:', endpoints.length);
```

## Social

The Social module provides functionalities for managing social hubs and channels within the Apillon platform. This includes creating, listing, and interacting with hubs and channels. In the background it utilizes Grill.chat, a mobile-friendly, anonymous chat application powered by Subsocial.
Expand Down

0 comments on commit aa522f0

Please sign in to comment.