Guides Products

Add a trend feed to your intranet

Show a live grid of innovations for your audience, with images.

3 steps6 min

  1. Fetch on your server

    Call the API from your backend so the key never reaches a browser. Pick filters that match your audience.

    TypeScript
    import { TrendWatching } from "@trendwatching/sdk";
    
    const tw = new TrendWatching(process.env.TW_API_KEY!);
    
    export async function trendFeed() {
      return tw.innovations.list({
        tags: ["audiences:gen-z"],
        limit: 12,
      });
    }
  2. Render the cards

    Each row has image_url and image_alt for a cover image. Image links are permanent, so you can store them with the rest of the row.

    TypeScript
    const items = await trendFeed();
    const html = items
      .map((i) => `<article>
        ${i.image_url ? `<img src="${i.image_url}" alt="${i.image_alt}">` : ""}
        <h3>${i.name}</h3>
        <p>${i.essence ?? ""}</p>
      </article>`)
      .join("");
  3. Cache it

    A feed like this changes a few times a day. Cache the response for an hour or so to keep page loads fast and usage low.