api-sdk

Guide @nuclia/core SDK usage and Angular service wrappers in a monorepo.

56|18|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/nuclia/frontend --skill api-sdk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-sdk
Source: https://github.com/nuclia/frontend/tree/main/.claude/skills/api-sdk
Command: npx skills add https://github.com/nuclia/frontend --skill api-sdk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill clarifies the structure and usage of the Nuclia SDK and its Angular wrappers, ensuring efficient and correct API interactions within the monorepo.

Core Features & Use Cases

  • SDK Architecture: Understand the core components like Nuclia class, rest, db, and auth layers.
  • API Call Integration: Learn how to add new API endpoints and wrap SDK calls in Angular services.
  • Error Handling: Implement robust error handling patterns for both search/ask responses and standard REST errors.
  • Use Case: When building a new feature that requires fetching data from a Nuclia Knowledge Box, this Skill guides you on the best practices for using the SDK and integrating it into your Angular application.

Quick Start

Explain how to add a new API call to the Nuclia SDK.

Frequently Asked Questions about api-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new API call to the Nuclia SDK in a TypeScript backend integration?

To add a new API call to the Nuclia SDK, you utilize the core `Nuclia` class and its `rest`, `db`, or `auth` layers. This ensures correct endpoint extension and seamless API interactions within your TypeScript monorepo.

What is the best way to wrap Nuclia SDK calls in Angular services?

The best way to wrap Nuclia SDK calls in Angular services is by using the `@flaps/core` wrappers. This architecture facilitates tasks like KnowledgeBox interaction and RetrievalAgent queries while maintaining clean backend integration.

How does error handling work for search and ask responses in the Nuclia SDK?

Error handling in the Nuclia SDK implements robust patterns for both search/ask responses and standard REST errors. It ensures HTTP errors are caught and managed correctly when interacting with global or regional backends.

When should I route API calls to a regional backend instead of a global backend?

You should route API calls to a regional or global backend based on your specific URL routing requirements and data residency needs. The SDK provides distinct URL routing patterns to manage these backend interactions effectively.

Can I use the Nuclia SDK to fetch data from a KnowledgeBox in an Angular application?

Yes, you can use the `@nuclia/core` SDK to fetch data from a Nuclia KnowledgeBox. The Skill provides best practices for integrating these SDK calls directly into your Angular application architecture.

What are the core architectural components of the Nuclia TypeScript SDK?

The core architectural components of the Nuclia TypeScript SDK include the main `Nuclia` class alongside the `rest`, `db`, and `auth` layers. These layers structure endpoint extensions and manage API interactions within the monorepo.