{"library":"ronin","title":"RONIN Data Platform TypeScript Client","description":"The `ronin` package provides a robust, TypeScript-first client for interacting with the RONIN data platform. Currently at version 6.8.0, it offers an intuitive ORM-like interface designed for efficient data access, particularly optimized for serverless and edge environments. This library abstracts common database operations, enabling developers to seamlessly query, mutate, and manage records through a fluent API. It prioritizes type safety and developer experience, shipping with comprehensive TypeScript definitions. While a precise release cadence isn't published, the versioning suggests regular updates that align with new platform features and bug fixes. Key differentiators include its native TypeScript integration, performance optimization for modern deployment patterns like serverless functions, and direct, secure connectivity to the RONIN backend services.","language":"javascript","status":"active","last_verified":"Thu Apr 23","install":{"commands":["npm install ronin"],"cli":{"name":"ronin","version":null}},"imports":["import { Ronin } from 'ronin'","import type { RoninRecord } from 'ronin'","import { RoninError } from 'ronin'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { Ronin } from 'ronin';\n\ninterface Product extends RoninRecord {\n  id: string;\n  name: string;\n  price: number;\n  inStock: boolean;\n}\n\nasync function main() {\n  // Ensure RONIN_TOKEN is set as an environment variable\n  const roninClient = new Ronin({ token: process.env.RONIN_TOKEN ?? '' });\n\n  try {\n    // Create a new product record\n    const newProduct = await roninClient.create<Product>('products', {\n      name: 'Smart Coffee Maker',\n      price: 149.99,\n      inStock: true,\n    });\n    console.log('Created product:', newProduct.name, newProduct.id);\n\n    // Fetch all products\n    const allProducts = await roninClient.get<Product[]>('products');\n    console.log(`Found ${allProducts.length} products.`);\n\n    // Fetch a specific product by ID\n    if (newProduct.id) {\n      const fetchedProduct = await roninClient.getById<Product>('products', newProduct.id);\n      console.log('Fetched product by ID:', fetchedProduct?.name);\n    }\n\n    // Update a product\n    const updatedProduct = await roninClient.update<Product>('products', newProduct.id, { inStock: false });\n    console.log('Updated product status:', updatedProduct.name, 'inStock:', updatedProduct.inStock);\n\n    // Delete a product (example, uncomment to run)\n    // await roninClient.delete('products', newProduct.id);\n    // console.log('Deleted product:', newProduct.id);\n\n  } catch (error) {\n    console.error('Error interacting with RONIN database:', error);\n  }\n}\n\nmain();","lang":"typescript","description":"Initializes the Ronin client, creates a new product, fetches all products, retrieves a specific product by ID, and updates a product's status.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}