Appearance
Lovable
Use the Ned TypeScript SDK inside a Lovable project to build AI-powered apps with live Shopify data.
INFO
Lovable doesn't support MCP servers directly. This guide uses the Ned TypeScript SDK to pull data into your Lovable app.
What You'll Need
- A Lovable account
- A Ned AI API key
Step 1: Get Your API Key
- Go to app.meetned.com
- Open Settings → Developer
- Click Create API Key
- Copy the key
Step 2: Create a Lovable Project
Go to lovable.dev and create a new project
Tell Lovable to install the Ned SDK:
"Install the @ned-ai/sdk package"
Step 3: Add Your API Key
Set your API key as an environment variable in Lovable's project settings:
- Open your project Settings → Environment Variables
- Add:
- Key:
NED_API_KEY - Value:
ned_live_YOUR_API_KEY_HERE
- Key:
WARNING
Never hardcode your API key in the source code. Always use environment variables.
Step 4: Use the SDK
Ask Lovable to build features using the Ned SDK. Here are some prompts to try:
Sales Dashboard
"Build a dashboard that shows today's sales, revenue, and order count using the Ned SDK. Use
NedClientfrom@ned-ai/sdkwith theNED_API_KEYenv var. Callned.analytics.getSalesContext({ period: 'today' })to get the data."
Product Profitability Table
"Create a table showing my top 10 products by profit using the Ned SDK. Call
ned.analytics.getProductProfitability({ period: 'this_month', limit: 10, sort: 'profit' })and display the results."
Marketing Metrics Card
"Add a marketing metrics card that shows MER, CAC, and ROAS using
ned.analytics.getMarketingMetrics({ period: 'last_30_days' })from the Ned SDK."
SDK Quick Reference
typescript
import { NedClient } from '@ned-ai/sdk';
const ned = new NedClient({
apiKey: process.env.NED_API_KEY
});
// Sales
const sales = await ned.analytics.getSalesContext({ period: 'today' });
// Profitability
const profit = await ned.analytics.getProfitability({ period: 'this_month' });
// Customers
const customers = await ned.analytics.getCustomerSummary({ period: 'this_month' });
// Marketing
const marketing = await ned.analytics.getMarketingMetrics({ period: 'last_30_days' });See the full SDK documentation for all available methods.
Troubleshooting
"Module not found" error
Make sure the SDK is installed. Ask Lovable:
"Run
npm install @ned-ai/sdk"
"Authentication failed"
- Check that the
NED_API_KEYenvironment variable is set correctly - Verify the key starts with
ned_live_and hasn't been revoked
API calls fail at build time
The Ned API must be called server-side or from an API route — not from client-side code in the browser. Ask Lovable to create a server route or API endpoint that calls the SDK.

