API Referencesdks@platform/sdk-follows

@platform/sdk-follows

Typed TypeScript client for services/follows. The page is generated from the SDK package source plus its generated OpenAPI types.

Installation

npm install @platform/sdk-follows

You’ll also need the shared auth/client helpers:

npm install @platform/hosts @platform/sdk

Quick start

import { LoopClient } from "@platform/sdk";
import { platformHost, SERVICE_NAMES } from "@platform/hosts";
import { createFollowsClient } from "@platform/sdk-follows";
 
const loop = new LoopClient({
  clientId: process.env.LOOP_CLIENT_ID!,
  clientSecret: process.env.LOOP_CLIENT_SECRET!,
  redirectUri: "https://your-app.example.com/auth/loop/callback",
});
 
const follows = createFollowsClient({
  baseUrl: platformHost({ service: SERVICE_NAMES.FOLLOWS }),
  accessToken: tokens.access_token,
});

Use the convenience helpers below when the SDK exposes them, or call the typed endpoint methods directly with GET / POST / PATCH / DELETE.

Convenience helpers

This SDK does not add convenience helpers beyond the typed endpoint calls below.

Endpoint calls

GET /readyz

Underlying REST endpoint: GET /readyz

Parameters

None

Return type

Promise<{
  data?: paths["/readyz"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.GET("/readyz");

DELETE /v1/blocks

Underlying REST endpoint: DELETE /v1/blocks

Parameters

  • body: paths["/v1/blocks"]["delete"]["requestBody"]["content"]["application/json"]

Return type

Promise<{
  data?: paths["/v1/blocks"]["delete"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.DELETE("/v1/blocks", {
  body: {
    /* paths["/v1/blocks"]["delete"]["requestBody"]["content"]["application/json"] */
  },
});

POST /v1/blocks

Underlying REST endpoint: POST /v1/blocks

Parameters

  • body: paths["/v1/blocks"]["post"]["requestBody"]["content"]["application/json"]

Return type

Promise<{
  data?: paths["/v1/blocks"]["post"]["responses"]["201"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.POST("/v1/blocks", {
  body: {
    /* paths["/v1/blocks"]["post"]["requestBody"]["content"]["application/json"] */
  },
});

GET /v1/blocks/check

Underlying REST endpoint: GET /v1/blocks/check

Parameters

  • query: paths["/v1/blocks/check"]["get"]["parameters"]["query"]

Return type

Promise<{
  data?: paths["/v1/blocks/check"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.GET("/v1/blocks/check", {
  params: {
    query: {
      /* paths["/v1/blocks/check"]["get"]["parameters"]["query"] */
    },
  },
});

DELETE /v1/follows

Underlying REST endpoint: DELETE /v1/follows

Parameters

  • body: paths["/v1/follows"]["delete"]["requestBody"]["content"]["application/json"]

Return type

Promise<{
  data?: paths["/v1/follows"]["delete"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.DELETE("/v1/follows", {
  body: {
    /* paths["/v1/follows"]["delete"]["requestBody"]["content"]["application/json"] */
  },
});

POST /v1/follows

Underlying REST endpoint: POST /v1/follows

Parameters

  • body: paths["/v1/follows"]["post"]["requestBody"]["content"]["application/json"]

Return type

Promise<{
  data?: paths["/v1/follows"]["post"]["responses"]["201"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.POST("/v1/follows", {
  body: {
    /* paths["/v1/follows"]["post"]["requestBody"]["content"]["application/json"] */
  },
});

GET /v1/follows/check

Underlying REST endpoint: GET /v1/follows/check

Parameters

  • query: paths["/v1/follows/check"]["get"]["parameters"]["query"]

Return type

Promise<{
  data?: paths["/v1/follows/check"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.GET("/v1/follows/check", {
  params: {
    query: {
      /* paths["/v1/follows/check"]["get"]["parameters"]["query"] */
    },
  },
});

GET /v1/follows/counts/{subject_id}

Underlying REST endpoint: GET /v1/follows/counts/\{subject_id\}

Parameters

  • path: paths["/v1/follows/counts/{subject_id}"]["get"]["parameters"]["path"]
  • query?: paths["/v1/follows/counts/{subject_id}"]["get"]["parameters"]["query"]

Return type

Promise<{
  data?: paths["/v1/follows/counts/{subject_id}"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.GET("/v1/follows/counts/{subject_id}", {
  params: {
    path: {
      subject_id: "<subject_id>",
    },
    query: {
      /* paths["/v1/follows/counts/{subject_id}"]["get"]["parameters"]["query"] */
    },
  },
});

GET /v1/follows/followers/{subject_id}

Underlying REST endpoint: GET /v1/follows/followers/\{subject_id\}

Parameters

  • path: paths["/v1/follows/followers/{subject_id}"]["get"]["parameters"]["path"]
  • query?: paths["/v1/follows/followers/{subject_id}"]["get"]["parameters"]["query"]

Return type

Promise<{
  data?: paths["/v1/follows/followers/{subject_id}"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.GET("/v1/follows/followers/{subject_id}", {
  params: {
    path: {
      subject_id: "<subject_id>",
    },
    query: {
      /* paths["/v1/follows/followers/{subject_id}"]["get"]["parameters"]["query"] */
    },
  },
});

GET /v1/follows/following/{subject_id}

Underlying REST endpoint: GET /v1/follows/following/\{subject_id\}

Parameters

  • path: paths["/v1/follows/following/{subject_id}"]["get"]["parameters"]["path"]
  • query?: paths["/v1/follows/following/{subject_id}"]["get"]["parameters"]["query"]

Return type

Promise<{
  data?: paths["/v1/follows/following/{subject_id}"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await follows.GET("/v1/follows/following/{subject_id}", {
  params: {
    path: {
      subject_id: "<subject_id>",
    },
    query: {
      /* paths["/v1/follows/following/{subject_id}"]["get"]["parameters"]["query"] */
    },
  },
});