JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q30283F
  • License Apache v2

This is a plugin to get posts from subsocial spacesId and posts from some address

Package Exports

  • gatsby-source-subsocial
  • gatsby-source-subsocial/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gatsby-source-subsocial) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

How to use in gatsby

Step1: Create a gatsby project or use in a template

You can use the plugin in a template or new project, only must be a gatsby project.

Step1: Setup gatsby-config.js

Setup the file with these params:

  • substrateNodeUrl: subsocial websocket
  • ipfsNodeUrl : ipfs url
  • recommendedSpaceIds : Array of spaces you want to show
  • addressAccount : posts from address you want to show

For example

{
    resolve: `gatsby-source-subsocial`,
    options: {
    substrateNodeUrl: `wss://para.f3joule.space`,
    ipfsNodeUrl: `https://crustwebsites.net`,
    spaceIds: ["10497"],
    addressAccount: "3qrRD1nbHj5u8cRsJBd1mEm9JGM9jwfzKGQgQwx1vvuigZub",
    },
},

Step2: GraphQl requests in components

You have to build your query and make graphql requests according your render requirements

For example:

...
export const query = graphql`
  query {
    allSpacesSubsocial {
      edges {
        node {
          id
          content {
            name
            tags
            about
            email
            image
            links
            summary
            isShowMore
          }
        }
      }
    }
  }
`

Step3: Render your data

According query, render the posts

** Project demo**

https://github.com/huascarmm/subsocial-gatsby-example