Nuxt quickstart

Install the EDK SDK and add search, routing, and compute to a Nuxt application.

Documentation navigation

Install

terminal
npm install @edk/sdk
Use the browser-safe SDK in a page or component. Move filesystem helpers to a server route when needed.

Example

pages/index.vue
<script setup lang="ts">
import { EDK } from "@edk/sdk";

const { data: summary } = await useAsyncData("e2-demo", async () => {
  const e2 = new EDK();

  const places = await e2.search({
    feature: "restaurant",
    area: "Manhattan",
    mode: "auto",
    limit: 100,
  });

  const route = await e2.route.route({
    locations: [{ lat: 40.74, lon: -73.99 }, { lat: 40.71, lon: -74.01 }],
    mode: "walking",
  });

  const count = await e2.compute.feature("restaurant")
    .region("Manhattan")
    .near("park", 500)
    .count();

  return `${places.features.length} restaurants, ${count} near parks`;
});
</script>

<template>
  <main><p>{{ summary }}</p></main>
</template>

Search example

src/search.ts
import { EDK } from "@edk/sdk";

const e2 = new EDK({ searchUrl: "/search" });
const places = await e2.search({
  feature: ["restaurant", "hospital"],
  area: ["Manhattan", "Brooklyn"],
  mode: "auto",
  limit: 100,
});

console.log(places.features);
The universal EDK import routes browser search to HTTP /search. Set searchUrl to your API route when it lives elsewhere.

Next steps

Replace the example coordinates and feature with your own values. Continue with the SDK guide for Search, Routes, Compute, storage, and catalogs.