{"library":"strapi-sdk-javascript","title":"Strapi JavaScript SDK","type":"library","description":"The `strapi-sdk-javascript` package provides a client library for interacting with a Strapi backend, offering methods for CRUD operations, local and provider-based authentication (Facebook, GitHub, Google, Twitter), and file management. It aims to simplify API calls by abstracting HTTP requests. However, the package is officially unmaintained and deprecated by the Strapi team, who recommend using a standard HTTP client (like Axios or Fetch) configured for your Strapi API endpoints instead. The current stable version is 0.3.3, but it has not seen active development or releases for a significant period. Its key differentiator as an 'official' SDK is now moot due to its abandonment, with the recommended approach being direct API interaction. Developers should be aware it does not support newer Strapi features or GraphQL roadmap items.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install strapi-sdk-javascript"],"cli":null},"imports":["import Strapi from 'strapi-sdk-javascript';","import Strapi from 'strapi-sdk-javascript';\nconst strapi = new Strapi('http://localhost:1337');\nawait strapi.login('user', 'pass');","import type Strapi from 'strapi-sdk-javascript';"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://strapi.io","github":"https://github.com/strapi/strapi-sdk-javascript","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/strapi-sdk-javascript","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import Strapi from 'strapi-sdk-javascript';\n\nconst STRAPI_BASE_URL = process.env.STRAPI_URL ?? 'http://localhost:1337';\nconst STRAPI_USERNAME = process.env.STRAPI_USERNAME ?? 'testuser';\nconst STRAPI_PASSWORD = process.env.STRAPI_PASSWORD ?? 'password';\n\nasync function runStrapiSdkExample() {\n  console.log(`Connecting to Strapi at: ${STRAPI_BASE_URL}`);\n  const strapi = new Strapi(STRAPI_BASE_URL);\n\n  try {\n    // Local authentication\n    console.log('Attempting local login...');\n    await strapi.login(STRAPI_USERNAME, STRAPI_PASSWORD);\n    console.log('Login successful! Token stored.');\n\n    // Fetch entries (e.g., 'posts')\n    const posts = await strapi.getEntries('posts');\n    console.log(`Fetched ${posts.length} posts:`, posts.map(p => p.title));\n\n    // Example: Create an entry (assuming 'articles' is a content type)\n    // const newArticle = await strapi.createEntry('articles', { title: 'SDK Test Article', content: 'Content from SDK' });\n    // console.log('Created new article:', newArticle);\n\n    // Example: Get entry count\n    const postCount = await strapi.getEntryCount('posts');\n    console.log(`Total posts count: ${postCount}`);\n\n  } catch (error) {\n    console.error('Error during Strapi SDK operations:', error.message);\n    if (error.response) {\n      console.error('Server response:', error.response.data);\n    }\n  }\n}\n\nrunStrapiSdkExample();","lang":"typescript","description":"This quickstart demonstrates how to instantiate the Strapi SDK, perform local user authentication, and fetch entries from a Strapi API, including error handling. It uses environment variables for configuration.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}