The NativeLayer ADK provides a single line of code to inject privacy-safe, context-aware native ads into your LLM responses.
const ad = await nl.fetchAd({
context: "User asking about hiking gear recommendations",
location: "Denver, CO"
});
if (ad) {
// Seamlessly blend into your chat UI
renderNativeCard(ad);
}
Traditional ads break flow. NativeLayer enhances it.
Ads are matched to the user's conversation intent, ensuring high engagement and zero "banner blindness".
All PII is automatically redacted on the client-side before any request leaves your user's device.
Native formats command 3x higher CMP than banners. Designed for chat, voice, and visual interfaces.
Choose your platform.
<script src="https://prod-adk-nativelayer.web.app/nativelayer-sdk.js"></script>
const nl = new NativeLayer({ apiKey: 'YOUR_API_KEY' });
// Fetch ad based on user input
const ad = await nl.fetchAd({
context: "best running shoes for marathon",
location: "Boston, MA"
});
import { NativeLayer } from 'nativelayer-client';
const client = new NativeLayer(process.env.NL_API_KEY);
const response = await client.chatWithAds({
messages: chatHistory,
context: { intent: "purchase_intent" }
});
console.log(response.ads);
import requests
url = "https://api.nativelayer.ai/v1/progressiveAd"
payload = {
"apiKey": "YOUR_API_KEY",
"keywords": "best running shoes for marathon",
"placement": "Boston, MA"
}
response = requests.post(url, json=payload)
ad = response.json()
print(ad)
curl -X POST https://api.nativelayer.ai/v1/progressiveAd \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"keywords": "running shoes", "placement": "Boston"}'
Simulate requests and inspect the raw response.
Simulates the user's conversation topic
// Waiting for request...