🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@spines/sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spines/sdk

Official TypeScript SDK for the SPINES API

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

SPINES SDK

Official TypeScript SDK for the SPINES API — identify books from bookshelf photos and build structured, explorable collections.

Installation

npm install @spines/sdk

Quick Start

import { SpinesClient } from '@spines/sdk';

const spines = new SpinesClient({ apiKey: 'gtspn_live_...' });

// Search for books
const results = await spines.books.search({ query: 'Sapiens' });
console.log(results.data);

// List public collections
const collections = await spines.collections.list({ sort: 'popular', limit: 10 });

// Start a bookshelf recognition job
const job = await spines.recognition.start({
  image_url: 'https://example.com/shelf.jpg',
  title: 'My Bookshelf',
});
console.log(job.job_id); // poll with spines.recognition.status(job.job_id)

Available Resources

ResourceMethods
spines.bookssearch, get, pairings, collections
spines.collectionslist, get, create, update, delete, books, addBook, removeBook
spines.personaslist, get
spines.categorieslist
spines.readingListslist, add, update, remove
spines.recognitionstart, status
spines.profileget, update, credits

Error Handling

All API errors throw a SpinesError with structured details:

import { SpinesClient, SpinesError } from '@spines/sdk';

const spines = new SpinesClient({ apiKey: 'gtspn_live_...' });

try {
  await spines.books.get('non-existent-id');
} catch (err) {
  if (err instanceof SpinesError) {
    console.error(err.status);    // 404
    console.error(err.code);      // "NOT_FOUND"
    console.error(err.message);   // "Book not found"
    console.error(err.requestId); // "req_abc123"
  }
}

Configuration

const spines = new SpinesClient({
  apiKey: 'gtspn_live_...',           // Required — your API key
  baseUrl: 'https://getspines.com/api/v1', // Optional — defaults to production
});

Pagination

List endpoints return cursor-based paginated responses:

let cursor: string | undefined;

do {
  const page = await spines.collections.list({ limit: 20, cursor });
  for (const collection of page.data) {
    console.log(collection.title);
  }
  cursor = page.meta.has_more ? (page.meta.next_cursor ?? undefined) : undefined;
} while (cursor);

Requirements

  • Node.js 18+ (uses native fetch)
  • TypeScript 5.3+ recommended

Documentation

Full API reference and guides: getspines.com/developers

License

MIT

Keywords

spines

FAQs

Package last updated on 18 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts