@outerview/sdk
v0.1.3
Published
JavaScript client for the Outerview Stream API.
Maintainers
Readme
@outerview/sdk
The official JavaScript client for Outerview: stream the physical world through visual observations, locations, and time. Use it when your app needs to find things such as street trees, waterfront paths, construction activity, or other observable conditions instead of web pages.
- Website: outerview.ai
- Product docs: outerview.ai/docs
- API and billing: outerview.ai/docs/billing
Install
npm install @outerview/sdkCreate an API key in the Outerview developer console and keep it on your server. Do not expose a private API key in browser code.
import { createOuterviewClient } from "@outerview/sdk";
const outerview = createOuterviewClient({
apiKey: process.env.OUTERVIEW_API_KEY,
});Stream the world
stream() submits a visual stream and returns GeoJSON results with location,
capture date, and public properties. limit is enforced by the API key's plan.
const result = await outerview.stream({
query: "street trees in Toronto",
position: { points: [
{ latitude: 43.6532, longitude: -79.3832 },
{ latitude: 43.6629, longitude: -79.3957 },
] },
limit: 50,
});
for (const feature of result.data.geojson.features) {
console.log(feature.properties.name, feature.geometry);
}Set position.points when you want to search around one location or multiple
locations.
Stream interactive experiences
Use interactive() when your product needs only results that can be opened in
an immersive interactive viewer. This method always sends interactive: true; callers
cannot accidentally receive flat-only results.
const result = await outerview.interactive({
query: "walkable waterfront paths in Chicago",
limit: 50,
});
const captures = result.data.geojson.features;Pair an interactive result with @outerview/sdk-360 to mount a player in a web product.
Errors and custom environments
Failed requests throw OuterviewApiError, including the HTTP status and parsed
response body. Set baseUrl for a compatible development endpoint.
import { createOuterviewClient, OuterviewApiError } from "@outerview/sdk";
try {
await outerview.stream({ query: "bike lanes", limit: 50 });
} catch (error) {
if (error instanceof OuterviewApiError) {
console.error(error.status, error.body);
}
}Plans and limits
Free supports 5 RPM and 5 results per request. Starter supports 500 RPM and 50 results. Pro supports 2,000 RPM and 50 results with video access. Scale supports 8,000 RPM and 200 results with video access. See Outerview billing for current details.
