👾Solarplex API

Solarplex uses the AT Protocol for messaging, and Solana for content, points and micropayments.

Solarplex Integration Using AT Protocol

Welcome to the Solarplex Developer Guide for integrating AT Protocol functionalities. This guide will help you implement login features and manage posts and likes via AT Protocol.

Note: the API endpoint is a dummy. Please ping us to get the live API endpoint.

Prerequisites

Before you start, ensure you have the @usedispatch/atproto-apipackage installed in your development environment.


npm install @usedispatch/atproto-api

A) Logging In via Solarplex

To enable users to log in via Solarplex using AT Protocol, follow these steps:

  1. Import the BskyAgent from @usedispatch/atproto-api:

    
    import { BskyAgent } from '@usedispatch/atproto-api';
    
  2. Create a Bluesky Agent:

    Set up the agent to communicate with the Solarplex service.

    
    const agent = new BskyAgent({ service: '<https://solarplex.atprotocol.com>' });
    
  3. User Login:

    Users can log in with their credentials. Here, use environment variables to securely manage user credentials.

    
    await agent.login({
      identifier: process.env.SOLARPLEX_USERNAME,
      password: process.env.SOLARPLEX_PASSWORD,
    });
    

    Replace SOLARPLEX_USERNAME and SOLARPLEX_PASSWORD with the actual environment variables.

B) Managing Posts and Likes

1. Creating a Post

To create a post on Solarplex:


await agent.post({
    text: "Your post content here"
});

2. Fetching Posts

To get posts from Solarplex:


await agent.getPosts({ /* parameters */ }, { /* options */ });

You can customize the parameters and options based on your requirements.

3. Liking a Post

To like a post:


await agent.like(postUri, cid);

Replace postUri and cid with the URI of the post and the content identifier, respectively.

4. Viewing Likes

To view likes on a post:


await agent.getLikes({ /* parameters */ }, { /* options */ });

Customize the parameters and options as needed.

5. Deleting a Post

To delete a post:


await agent.deletePost(postUri);

Replace postUri with the URI of the post to be deleted.

For details of the above calls, please see the API docs below.

API Docs in detail

Community apps

https://atproto.com/community/projects

Last updated