SDK Snippet Card

members.ts
import { Sirius } from '@sirius/sdk'
const client = new Sirius(apiKey)
await client.members.create({ name })
About this piece

SDK Snippet Card

A code card with a filename header over syntax-toned, line-numbered source.

Usage

The import and the props worth knowing about, in one place.

import { Code13 } from "@/components/beste/piece/code13";

<Code13
  filename="members.ts"
  lines={[
    [
      {
        "text": "import",
        "tone": "keyword"
      },
      {
        "text": " { Sirius } "
      },
      {
        "text": "from",
        "tone": "keyword"
      },
      {
        "text": " "
      },
      {
        "text": "'@sirius/sdk'",
        "tone": "string"
      }
    ],
    [],
    [
      {
        "text": "const",
        "tone": "keyword"
      },
      {
        "text": " client = "
      },
      {
        "text": "new",
        "tone": "keyword"
      },
      {
        "text": " Sirius(apiKey)"
      }
    ],
    [
      {
        "text": "await",
        "tone": "keyword"
      },
      {
        "text": " client.members."
      },
      {
        "text": "create",
        "tone": "fn"
      },
      {
        "text": "({ name })"
      }
    ]
  ]}
  bordered={false}
/>

More Code pieces

View all Code
greet.ts
export function greet(name: string) {
return `Hello, ${name}!`;
}
 
console.log(greet("Beste"));
function greet(name) {
return 'Hi ' + name;
return `Hello, ${name}!`;
}
const greeting = "Hello, Beste!";ts
{
"name":"Beste",
"active":true,
"count":42
}
const user = await fetchUser("42");
TypeError: Cannot read 'name' of undefined
greet(src/utils.ts:14:12)
handler(src/server.ts:42:8)
processRequest(src/api.ts:88:4)