Complete reference of every operation, grouped by resource. See the README for usage and configuration.
import ScalarGalaxy from "@scalar/galaxy-sdk";
const client = new ScalarGalaxy({
bearerAuth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var
environment: "production",
});It's easy to say you know them all, but do you really? Retrieve all the planets and check whether you missed one.
| Direction | Type |
|---|---|
| Request | PlanetListAllDataParams |
| Response | PlanetListAllDataResponse |
const listAllData = await client.planets.listAllData({
limit: 10,
offset: 0,
});Time to play god and create a new planet. What do you think? Ah, don't think too much. What could go wrong anyway?
| Direction | Type |
|---|---|
| Request | PlanetCreateParams |
| Response | Planet |
const planet = await client.planets.create();You'll better learn a little bit more about the planets. It might come in handy once space travel is available for everyone.
| Direction | Type |
|---|---|
| Response | Planet |
const planet = await client.planets.retrieve(1);Sometimes you make mistakes, that's fine. No worries, you can update all planets.
| Direction | Type |
|---|---|
| Request | PlanetUpdateParams |
| Response | Planet |
const planet = await client.planets.update(1);This endpoint was used to delete planets. Unfortunately, that caused a lot of trouble for planets with life. So, this endpoint is now deprecated and should not be used anymore.
await client.planets.delete(1);Got a crazy good photo of a planet? Share it with the world!
| Direction | Type |
|---|---|
| Request | PlanetUploadImageParams |
| Response | PlanetUploadImageResponse |
const uploadImage = await client.planets.uploadImage(1);| Direction | Type |
|---|---|
| Request | CelestialBodyCreateParams |
| Response | CelestialBody |
const celestialBody = await client.celestialBodies.create({
name: "",
type: "planet",
});Time to create a user account, eh?
| Direction | Type |
|---|---|
| Request | AuthenticationCreateUserParams |
| Response | User |
const user = await client.authentication.createUser();Yeah, this is the boring security stuff. Just get your super secret token and move on.
| Direction | Type |
|---|---|
| Request | AuthenticationCreateTokenParams |
| Response | AuthenticationCreateTokenResponse |
const createToken = await client.authentication.createToken();Find yourself they say. That's what you can do here.
| Direction | Type |
|---|---|
| Response | User |
const user = await client.authentication.listMe();