New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@reasked/node

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reasked/node

Reasked Node SDK

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Reasked Node SDK

npm version License: MIT

The official Node.js SDK for the Reasked API - a powerful FAQ management platform.

Installation

npm install @reasked/node
yarn add @reasked/node
pnpm add @reasked/node

Quick Start

import { Reasked } from "@reasked/node";

const reasked = new Reasked("your-api-key");

// Get FAQ group by slug
const faqGroup = await reasked.faq.getFaqGroupBySlug("getting-started");

if (faqGroup.status === "success") {
  console.log(faqGroup.data);
}

Configuration

Basic Configuration

const reasked = new Reasked("your-api-key", {
  timeout: 30000, // Request timeout in ms (default: 30000)
  retries: 3, // Number of retries (default: 3)
  debug: false, // Enable debug logging (default: false)
});

Environment Variables

You can also configure the SDK using environment variables:

REASKED_API_KEY=your-api-key

API Reference

FAQ Service

getFaqGroupBySlug(slug, options?)

Retrieve an FAQ group by its slug.

const response = await reasked.faq.getFaqGroupBySlug("getting-started", {
  status: "published", // 'all' | 'draft' | 'published'
  langs: ["en", "es"], // Array of language codes
});

getFaqGroupById(id, options?)

Retrieve an FAQ group by its ID.

const response = await reasked.faq.getFaqGroupById("00000000-0000-0000-0000-000000000000",
  status: "published",
  langs: ["en"],
});

Response Format

All API methods return a standardized response:

{
  status: 'success' | 'error',
  data?: FaqGroupData,
  message?: string
}

Data Types

FaqGroupData

interface FaqGroupData {
  id: string;
  status: "draft" | "published";
  createdAt: string;
  updatedAt: string;
  translations: FaqGroupTranslation[];
  faqs: Faq[];
}

Faq

interface Faq {
  id: string;
  status: "draft" | "published";
  position: number;
  createdAt: string;
  updatedAt: string;
  translations: FaqTranslation[];
}

FaqTranslation

interface FaqTranslation {
  question: string;
  answer: string;
  lang: string;
  id: string;
  createdAt: string;
  updatedAt: string;
}

Advanced Usage

Error Handling

try {
  const response = await reasked.faq.getFaqGroupBySlug("non-existent");

  if (response.status === "error") {
    console.error("API Error:", response.message);
    return;
  }

  // Handle success
  console.log(response.data);
} catch (error) {
  console.error("Network Error:", error.message);
}

TypeScript Support

The SDK is written in TypeScript and includes full type definitions:

import { Reasked, FaqGroupData, ReaskedResponse } from "@reasked/node";

const reasked = new Reasked("your-api-key");

const response: ReaskedResponse<FaqGroupData> =
  await reasked.faq.getFaqGroupBySlug("getting-started");

Development

Building

pnpm run build

Testing

pnpm test

Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Made with ❤️ by the Reasked team

Keywords

reasked

FAQs

Package last updated on 13 Jul 2025

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