Integration patterns
This guide explains how AISquare fits into different application architectures.
Depending on your use case, you can integrate AISquare in multiple ways.
Overview
AISquare is typically used as a backend service layer that powers:
- Content feeds
- Personalization
- Analytics
- AI-driven experiences
Most integrations follow this pattern:
Your backend acts as the integration layer between your application and AISquare.
Pattern 1: Frontend + backend integration (recommended)
This is the most common and recommended setup.
Architecture
How it works
- User interacts with your app
- Your backend calls AISquare APIs
- Your backend processes the response
- Frontend renders the data
Why use this pattern
- Keeps API keys secure
- Allows custom business logic
- Enables caching and transformations
- Supports personalization
Example use case
- Displaying AI Studio content feed
- Showing personalized recommendations
- Building dashboards
Pattern 2: Server-to-server integration
Used when AISquare is part of your backend workflows.
Architecture
How it works
- Your backend directly calls AISquare
- No frontend involvement required
- Runs as part of internal services or pipelines
Example use case
- Syncing user data
- Generating reports
- Running analytics jobs
Pattern 3: Platform embedding (partner integration)
Used when AISquare powers features inside another platform.
Example: integrating AISquare into a product like a learning or gaming platform.
Architecture
Key idea
Your platform:
- Manages users
- Handles authentication
- Calls AISquare on behalf of users
AISquare acts as a data and intelligence layer.
Important considerations
- Register users via API
- Store API keys securely
- Map your user IDs to AISquare users
Choosing the right pattern
Best practices
Use a backend layer
Never call AISquare directly from the frontend with sensitive credentials.
Store credentials securely
- API keys should be stored on your backend
- Never expose them in client-side code
Handle errors gracefully
- Retry failed requests
- Handle authentication errors
- Validate inputs before sending requests
Use pagination
Avoid fetching large datasets at once.
Putting it together
A typical AISquare integration looks like:
- User opens your app
- Backend authenticates user
- Backend fetches AISquare data
- Frontend renders content
- User interacts with resources
Related pages
- Authentication — set up API keys and tokens
- Build your first integration — step-by-step guide
- User onboarding & account lifecycle — manage users programmatically
- Token lifecycle & session management — manage tokens in production
- Permissions and access control — understand access patterns
- Errors — handle error responses gracefully

