# Social Feeds > Social Feeds by Ninety Six Software shows a business's own Instagram posts on its website. It's an npm package (@ninetysixsoftware/social-feeds) for EmDash and Astro sites, and an embed for any website. Posts are rendered on the server from a cached JSON feed, with images resized once and served from Cloudflare's cache. It only reads the Instagram account's profile and posts. This is the full reference, for coding agents. Human-readable versions: - [Docs](https://feeds.ninetysixsoftware.co.uk/docs): every setting, prop, slot, token, class and attribute - [Overriding the design](https://feeds.ninetysixsoftware.co.uk/docs/overriding): copy-ready recipes - [Help](https://feeds.ninetysixsoftware.co.uk/help): account, connection and billing questions - [Claude Code skill](https://feeds.ninetysixsoftware.co.uk/docs#install): `npx @ninetysixsoftware/social-feeds init --claude` copies it to .claude/skills/social-feed/SKILL.md ## Install EmDash site: run `npx @ninetysixsoftware/social-feeds init` in the site's folder. It installs the package and adds `socialFeeds()` to `emdash({ plugins: [...] })` in astro.config.mjs, with `import socialFeeds from "@ninetysixsoftware/social-feeds"`. Idempotent. Options: --feed , --claude, --dry-run, --no-install. Nothing is needed in wrangler.jsonc. The admin page stores the site key encrypted, which needs EMDASH_ENCRYPTION_KEY. Then the site owner opens the admin, Plugins, then Social Feeds, starts a trial or links an account (this saves the site key and remembers the feed), and connects Instagram. Only the npm package: there's no separate registry plugin to install. Astro without EmDash: install @ninetysixsoftware/social-feeds and use the component. The owner starts a trial at https://feeds.ninetysix.dev/sign-up. Any website: the owner adds the site's address in their Social Feeds account (https://feeds.ninetysix.dev), connects Instagram, and pastes:
## Place the feed in a template --- import SocialFeed from "@ninetysixsoftware/social-feeds/SocialFeed.astro"; --- - On EmDash, no feed prop: it shows the feed linked in the Social Feeds admin page, with the site key saved there. On plain Astro, add feed="your-feed-id". - Renders on the server. Renders nothing (or the empty slot) when there are no posts or the service doesn't answer within 2 seconds. - On a prerendered page (prerender = true, or output: "static") the feed only updates on rebuild. Use `export const prerender = false`. - The feed id is public. Only needed on plain Astro, or when socialFeeds({ feeds: [...] }) lists several. Ask the user for it if it isn't in an existing component. ## Match the site's design, in this order 1. Settings in the Social Feeds admin (or the user's account), ideally saved as a named look and used with look="Name". Shows without a deploy, within about 5 minutes. Agents can't change settings, so tell the user which to pick. 2. Props on the component, or data attributes on the embed, for one placement. 3. --nsf-* tokens in the site's CSS, on the class given to the component. 4. The site's CSS on .nsf-feed__* classes and data attributes. Rules: - Never use !important. The feed's CSS is in `@layer nsf` behind :where(), so any unlayered site CSS wins. - Astro scoped styles don't reach the feed's markup. Use :global(.site-feed) or a global stylesheet. - If the site's CSS is in cascade layers (Tailwind 4), put `@layer nsf;` at the top of the main stylesheet, before any @import. - heading="h2" or "h3" makes the feed's heading take the site's heading styles. ## Component props - feed (string): The feed id from Social Feeds. Not a secret. On an EmDash site, leave it out to show the feed linked in the Social Feeds admin page. Required on other Astro sites. - look (string): A named look, by id or name. Blank uses the default look. - class (string): Extra classes on the feed's section, for your CSS. - any setting (as in the settings): Overrides that setting for this placement. Use the setting's name or camelCase: captionLines, scrollBy, arrowsPosition, fadeIn, showMore, followStyle, followLabel. - columns ({ phone, tablet, desktop }): Tiles across. Give any of the three. - title (string or false): The heading text. false hides the whole header. - follow (string or false): The Follow link's label. false hides the link. - followPosition ("header" or "below"): Where the Follow link goes. - siteKey (string): The feed's site key. Defaults to the SOCIAL_FEEDS_KEY_ or SOCIAL_FEEDS_KEY secret, which is better than a prop. - cacheSeconds (number): How long the site's server reuses the feed. Default 60. 0 turns it off. - nonce (string): Your Content Security Policy's nonce, put on the feed's style elements, so style-src needs no 'unsafe-inline'. - apiOrigin (string): Another copy of the service, for testing. SOCIAL_FEEDS_API does the same for every feed. ## Slots - header: Replaces what's inside the header: the heading, the profile and the Follow link. - footer: Added below the posts, after Show more and the Follow link. - empty: Shown when there are no posts, or Social Feeds doesn't answer within 2 seconds. Without it, nothing is shown. ## Settings The same names in the JSON API and as props. Props also take camelCase (captionLines, scrollBy, arrowsPosition, fadeIn, showMore, followStyle, followLabel). Each feed has a default look and up to 5 named looks, each a full set of settings. ### Layout - layout: default "strip". Values: strip, grid, carousel, masonry. strip is one row that scrolls sideways, with columns posts across. carousel shows one post at a time, centred and up to --nsf-carousel-width wide, and ignores columns. grid wraps into rows. masonry is columns of images at their own heights. - posts: default null. Values: 1 up to the plan's posts per feed, or null. How many posts to show. null shows every post the plan allows. Only trims what's shown, it never fetches more. With show_more, the size of each batch. - show_more: default false. Values: true, false. Grid and masonry only. A Show more button adds another batch of posts, up to the plan's posts per feed. ### Size - columns: default {"phone":2.4,"tablet":4,"desktop":6}. Values: phone 1 to 4, tablet 1 to 8, desktop 1 to 10, to one decimal place. Tiles across. Tablet starts at 640px wide and desktop at 1024px. In a strip, a fraction like 2.4 shows part of the next tile, so people can see it scrolls. Grid and masonry round down to whole tiles. - gap: default 12. Values: 0 to 48 (pixels). The space between tiles. - radius: default 8. Values: 0 to 48 (pixels). Corner radius of the tiles. Buttons and the arrows below the posts use half of it. - shape: default "square". Values: square, portrait, landscape, original. square is 1:1, portrait 4:5, landscape 4:3, and original keeps each image's own shape. Masonry always uses original. - fit: default "cover". Values: cover, contain. cover crops each image to fill its tile. contain fits the whole image inside, so posters and graphics keep their edges. - border: default false. Values: true, false. A border round each tile, border_width wide, in border_color. - tile_size: default {"phone":null,"tablet":null,"desktop":null}. Values: { phone, tablet, desktop }, each 60 to 800 or null. A post's width in pixels on that device, instead of columns. A strip uses it for each post, a grid fits as many as there's room for, masonry makes columns that wide, and a carousel's post is that wide. null uses columns. - border_width: default 1. Values: 1 to 8. The border's width in pixels, when border is on. - border_color: default null. Values: a colour like #d4a73a, or null. The border's colour. null is a soft line from the text colour (--nsf-border). ### Scrolling - snap: default "start". Values: none, start, center. Where a strip or carousel comes to rest after scrolling. none lets it stop anywhere. - arrows: default "hover". Values: always, hover, never. Arrows for a strip or carousel. hover shows them when the pointer is over the feed, and hides the side arrows on touch screens, which swipe instead. - edge: default {"phone":false,"tablet":false,"desktop":false}. Values: phone, tablet and desktop, each true or false. A strip or carousel runs out to the screen's edges on that device, while its first tile still lines up with the page. Needs the feed's script, which measures the gap to the edge. An ancestor with overflow hidden clips it. - arrows_position: default "sides". Values: sides, below. sides puts round buttons over the posts. below puts square buttons under them, greyed out at each end. - scroll_by: default "page". Values: page, tile. What the arrows and autoplay move by: a page of tiles, or one tile. - fade: default false. Values: true, false. Fades the edges of a strip or carousel where there's more to scroll to. - drag: default true. Values: true, false. Lets people drag a strip or carousel sideways with a mouse. Touch always scrolls. - autoplay: default 0. Values: 0, or 2 to 15 (seconds). Seconds between automatic moves in a strip or carousel. 0 is off. It pauses on hover and focus, and never runs for people who ask for reduced motion. ### Content - captions: default "off". Values: off, below, hover. Captions without hashtags, under each tile or over it on hover. Touch screens always show hover captions. - caption_lines: default 2. Values: 1 to 6. Lines of caption before it's cut off. - badges: default true. Values: true, false. Small video and carousel icons on tiles. ### Header and Follow link - header: default "username". Values: none, username, profile, icon. username shows the heading (the title, or @username). profile shows the account's picture, name and @username. icon shows an Instagram icon with the heading and the intro line. none hides the header. - title: default null. Values: up to 80 characters, or null. The heading instead of @username. null uses the username. - subtitle: default null. Values: up to 160 characters, or null. An intro line under the heading. - heading: default "p". Values: p, h2, h3. The heading's element. h2 and h3 take the site's own heading styles. p uses the feed's --nsf-title-font and --nsf-title-size. - accent: default null. Values: a colour like #2cf08b, or null. The colour of button and arrow hovers, focus rings, and the Instagram icon unless icon_color is set. null follows the text colour. - font: default "site". Values: site, sans, serif, mono, grotesque, humanist, geometric, classical, rounded, condensed, old_style, slab, didone, handwritten. The feed's text. site keeps the page's own font. The others are font stacks already on people's devices, so nothing extra loads, and each looks a little different on Mac, Windows and phones. A heading set to h2 or h3 keeps the site's heading font. - text_color: default null. Values: a colour like #1d1e20, or null. The colour of the heading, captions and links. null follows the site. - icon_style: default "outline". Values: outline, solid, gradient. The Instagram icon in the icon header: an outline, filled in, or in Instagram's own gradient. - icon_color: default null. Values: a colour like #e1306c, or null. The icon's colour. null uses accent. Not used for the gradient. - follow: default "header". Values: off, header, below. Where the link to the Instagram profile goes: off, in the header, or below the posts. - follow_label: default "Follow on Instagram". Values: 1 to 40 characters. The Follow link's text. - follow_style: default "link". Values: link, button, pill. A plain link, a button, or a pill (a fully rounded button). - follow_fill: default "outline". Values: outline, filled. For a button or pill: outlined, or filled with the accent colour (the text colour if there's no accent), with black or white text to suit. - header_position: default "above". Values: above, below. The header above or below the posts. A Follow link in the header moves with it. - header_align: default "spread". Values: spread, start, center, end. spread puts the heading at the start and the Follow link at the end. start, center and end keep them together there. - footer_align: default "center". Values: start, center, end. Where Show more and a Follow link below the posts sit. - title_size: default null. Values: 10 to 72, or null. The heading's or name's size in pixels. null uses the feed's own, or the site's heading style. - title_weight: default null. Values: 300, 400, 500, 600, 700, 800, 900, or null. The heading's or name's weight. null uses the feed's own, or the site's heading style. - follow_size: default null. Values: 10 to 32, or null. The Follow link's text size in pixels. null matches the feed. - follow_weight: default null. Values: 300, 400, 500, 600, 700, 800, 900, or null. The Follow link's weight. null uses the feed's own. - icon_size: default 44. Values: 29 to 96. The Instagram icon's and profile picture's size in pixels. 29 is the smallest Instagram allows for its icon. ### Motion and clicks - hover: default "zoom". Values: none, zoom, darken, lift. What a tile does under the pointer: nothing, zoom the image, darken it, or lift the tile and zoom. - fade_in: default true. Values: true, false. Images fade in as they load. - click: default "instagram". Values: instagram, lightbox, none. instagram opens the post on Instagram. lightbox shows it larger on the page with its caption. none means tiles aren't links. Plan: lightbox needs Pro or Agency. On other plans it falls back to "instagram". ### Stored - version: default 4. Values: 4. The schema version. Older stored settings are upgraded when read, and every new setting's default keeps an older feed looking as it did. - hidden: default []. Values: a list of post ids. Posts the site has hidden in the admin. They're never sent in the public feed and don't count towards the plan's posts per feed. ## Named looks - Use a look by id or name, ignoring case: look="Gallery grid" on the component, data-look="gallery-grid" on the embed, ?look= on the API. - A look's id is its name in lowercase with dashes. An unknown look shows the default look. ## Tokens - --nsf-columns (default var(--nsf-columns-phone, 2.4)): Tiles across at the current width. Set it to fix the number at every width. - --nsf-columns-phone (default 2.4 (setting)): Tiles across below 640px. From the columns setting. - --nsf-columns-tablet (default 4 (setting)): Tiles across from 640px. From the columns setting. - --nsf-columns-desktop (default 6 (setting)): Tiles across from 1024px. From the columns setting. - --nsf-gap (default 12px): Space between tiles. From the gap setting. - --nsf-radius (default 8px): Tile corners. From the radius setting. - --nsf-aspect (default 1): Tile shape, from the shape setting: 1, 4 / 5, 4 / 3 or auto. - --nsf-tile-bg (default color-mix(in srgb, currentColor 8%, transparent)): Shows behind each image while it loads. - --nsf-title-font (default inherit): The heading's font, when the heading is a p. - --nsf-title-size (default 1.25rem): The heading's size. title_size sets it, and then it beats the site's heading style too. - --nsf-avatar-size (default 44px): The profile picture and Instagram icon in the header. - --nsf-muted (default color-mix(in srgb, currentColor 62%, transparent)): The intro line and @username. - --nsf-button-radius (default 999px): The corners of a pill Follow button. - --nsf-button-border (default color-mix(in srgb, currentColor 28%, transparent)): The outline of buttons and the arrows below the posts. - --nsf-button-bg: A filled Follow button's colour. From the accent setting, otherwise the text colour. - --nsf-button-fg: A filled Follow button's text: black or white, whichever reads on --nsf-button-bg. - --nsf-edge-start: With the edge setting, the gap from the feed's left to the screen's edge. The feed's script measures it, and you can set it yourself. - --nsf-edge-end: The same on the right. - --nsf-caption-font (default inherit): Caption font. - --nsf-caption-size (default 0.875rem): Caption size. - --nsf-caption-lines (default 2): Lines before a caption is cut off. From the caption_lines setting. - --nsf-caption-overlay (default rgb(0 0 0 / 0.62)): Behind captions shown on hover. - --nsf-darken (default rgb(0 0 0 / 0.28)): The darken hover's colour. - --nsf-arrow-bg (default Canvas): Round arrows' background. Canvas follows the page's colour scheme. - --nsf-arrow-fg (default CanvasText): Round arrows' icon colour. - --nsf-arrow-size (default 44px): Arrow button size. - --nsf-fade-size (default 48px): How far the edge fade reaches. - --nsf-carousel-width (default 640px): The widest a carousel's post gets. On wider screens the posts either side peek in. - --nsf-accent (default currentColor): Hovers, focus rings, and the Instagram icon unless --nsf-icon is set. From the accent setting. - --nsf-icon: The Instagram icon's colour. From the icon_color setting, otherwise --nsf-accent. - --nsf-text: The feed's text colour. From the text_color setting, otherwise the site's. - --nsf-font: The feed's font. From the font setting, otherwise the site's. - --nsf-focus (default var(--nsf-accent)): Focus rings. Follows --nsf-accent. - --nsf-border (default color-mix(in srgb, currentColor 16%, transparent)): Tile borders, when the border setting is on. border_color sets it. - --nsf-border-width: The tile border's width. border_width sets it. - --nsf-follow-size: The Follow link's text size, when follow_size is set. - --nsf-follow-weight: The Follow link's weight, when follow_weight is set. - --nsf-title-weight: The heading's weight, when title_weight is set. - --nsf-control-radius (default calc(var(--nsf-radius) / 2)): Corners of outlined buttons and the arrows below the posts. Half of --nsf-radius. - --nsf-badge (default #fff): Video and carousel icons. - --nsf-hover-zoom (default 1.04): How far the zoom hover scales the image. 1 turns it off. - --nsf-lightbox-backdrop (default rgb(0 0 0 / 0.82)): Behind the lightbox. - --nsf-lightbox-bg (default Canvas): The lightbox panel. Unless you set it, it takes the page's background. - --nsf-lightbox-fg (default CanvasText): The lightbox text. Unless you set it, it takes the feed's text colour. Example: .site-feed { --nsf-radius: 0; --nsf-gap: 16px; --nsf-columns-desktop: 4; --nsf-accent: #2cf08b; } ## Classes - .nsf-feed: The whole feed, a section. Carries the data attributes below. - .nsf-feed__header: The header row: the heading or profile, and the Follow link. data-header says which. - .nsf-feed__intro: The heading and intro line, with header username. - .nsf-feed__title: The heading, with header username. - .nsf-feed__subtitle: The intro line. - .nsf-feed__profile: The picture or icon and the names, with header profile or icon. - .nsf-feed__avatar: The profile picture, or its first letter. - .nsf-feed__icon: The Instagram icon, with header icon. - .nsf-feed__names: The name and the line under it. - .nsf-feed__name: The heading, with header profile or icon. - .nsf-feed__username: The @username under the name. - .nsf-feed__follow: The Follow link. data-style is link, button or pill. - .nsf-feed__viewport: Holds the posts and the side arrows. - .nsf-feed__track: The list of posts. It scrolls in a strip or carousel. - .nsf-feed__item: One post. data-type is image, video or carousel. - .nsf-feed__link: The post's link, or a div when click is none. - .nsf-feed__media: The image's frame, which clips the corners. - .nsf-feed__img: The image. - .nsf-feed__badge: The video or carousel icon. - .nsf-feed__caption: The caption. - .nsf-feed__nav: An arrow button. - .nsf-feed__nav--prev: The previous arrow. - .nsf-feed__nav--next: The next arrow. - .nsf-feed__controls: The row of arrows below the posts. - .nsf-feed__footer: Below the posts: Show more and the Follow link. - .nsf-feed__more: The Show more button. - .nsf-lightbox: The lightbox, a dialog inside the feed. - .nsf-lightbox__frame: The lightbox's two columns. - .nsf-lightbox__media: The lightbox image's frame. - .nsf-lightbox__img: The lightbox image. - .nsf-lightbox__panel: The caption side of the lightbox. - .nsf-lightbox__title: The lightbox heading. - .nsf-lightbox__caption: The full caption. - .nsf-lightbox__date: The post's date. - .nsf-lightbox__open: The link to the post on Instagram. - .nsf-lightbox__close: The close button. - .nsf-lightbox__nav: The lightbox's arrows. - .nsf-lightbox__nav--prev: The lightbox's previous arrow. - .nsf-lightbox__nav--next: The lightbox's next arrow. ## Data attributes - data-layout on .nsf-feed: The layout setting. - data-shape on .nsf-feed: The shape setting. - data-snap on .nsf-feed: The snap setting. - data-arrows on .nsf-feed: The arrows setting. - data-arrows-position on .nsf-feed: sides or below, when there are arrows. - data-captions on .nsf-feed: The captions setting. - data-hover on .nsf-feed: The hover setting. - data-fit on .nsf-feed: The fit setting. - data-border on .nsf-feed: Present when tiles have borders. - data-click on .nsf-feed: The click setting. - data-scroll-by on .nsf-feed: page or tile, in a strip or carousel. - data-fade on .nsf-feed: Present when a strip or carousel fades at its edges. - data-edge on .nsf-feed: The devices a strip or carousel runs to the screen's edges on: phone, tablet and desktop, space separated. - data-device on .nsf-feed: Only in the admin previews: the device they show, so the edge follows it. - data-header-align on .nsf-feed: start, center or end, when the header isn't spread. - data-header-position on .nsf-feed: below, when the header is under the posts. - data-footer-align on .nsf-feed: start or end, when the footer isn't centred. - data-title-size, data-title-weight on .nsf-feed: Present when the heading's size or weight is set, which then beats the site's heading style. - data-follow-size, data-follow-weight on .nsf-feed: Present when the Follow link's size or weight is set. - data-fill-ready on .nsf-feed: Present once a filled Follow button's colour is known, from the settings or the site's text colour. - data-fill on .nsf-feed__follow: filled for a filled button or pill. - data-drag on .nsf-feed: Present when a strip or carousel can be dragged with a mouse. - data-autoplay on .nsf-feed: Seconds between moves, when autoplay is on. - data-fade-in on .nsf-feed: Present when images fade in. - data-batch on .nsf-feed: Posts per batch, when Show more is on. - data-nsf-id on .nsf-feed: A unique id for this placement. The setting tokens are scoped to it. - data-nsf-feed on .nsf-feed: The feed id. - data-ready on .nsf-feed: Added once the script is running. - data-at-start on .nsf-feed: Added while a strip is scrolled to the start. - data-at-end on .nsf-feed: Added while a strip is scrolled to the end. - data-dragging on .nsf-feed: Added while someone drags the strip. - data-header on .nsf-feed__header: none, username, profile, icon, or custom for the header slot. - data-type on .nsf-feed__item: image, video or carousel. - data-style on .nsf-feed__follow: link, button or pill. - data-caption on .nsf-feed__link: The caption, for the lightbox. - data-time on .nsf-feed__link: The post's date, for the lightbox. - data-loaded on .nsf-feed__img: Added when the image has loaded, for the fade in. ## Embed attributes - data-social-feed: Required. The feed id. - data-look: A named look, by id or name. - nonce (on the script tag): Your Content Security Policy's nonce. The embed puts it on the feed's style elements too. - data-layout, data-posts, data-gap and the rest: Any setting, with dashes: data-caption-lines, data-arrows-position, data-scroll-by, data-follow-style, data-show-more. - data-columns-phone, data-columns-tablet, data-columns-desktop: Tiles across at each width. - data-edge-phone, data-edge-tablet, data-edge-desktop: true or false. A strip runs to the screen's edges at that width. - data-tile-size-phone, data-tile-size-tablet, data-tile-size-desktop: A post's width in pixels at that width, or auto to use columns. - data-title: The heading. Empty hides the header. - data-follow: off, header or below. Empty or false hides the link. Any other text is the link's label. The embed only loads on the site addresses in the feed's Social Feeds account. ## JSON API GET https://feeds.ninetysixsoftware.co.uk/api/feeds/?limit=1-50&look= Returns { feed, username, name, avatar_url, profile_url, updated_at, settings, looks, posts: [{ id, type, image_url, thumbnails: { "320", "640" } or null, permalink, caption, timestamp }] }. Never more posts than the plan allows. No posts when not connected or the plan has ended. Unknown feed: 404. Cached up to 5 minutes. CORS only for the feed's site addresses. From a server, send Authorization: Bearer to be rate limited per site (1,200 a minute) instead of per address (120 a minute). ## Your own markup import { getFeed, normaliseSettings, renderFeed, FEED_CSS } from "@ninetysixsoftware/social-feeds"; const feed = await getFeed("your-feed-id"); // null if not fetched within 2 seconds // feed.username, feed.profileUrl, feed.settings, feed.looks // feed.posts[].{ id, type, permalink, caption, captionText, timestamp, alt, src, srcset } const html = feed ? renderFeed(feed, normaliseSettings(feed.settings, { layout: "grid" })) : ""; getFeed options: limit, look, siteKey, cacheSeconds (default 60), timeoutMs (default 2000), apiOrigin. In the browser, `import { enhanceAll } from "@ninetysixsoftware/social-feeds/behaviour"` adds arrows, dragging, Show more and the lightbox. ## Site key nsk_... keys let the EmDash admin page manage the feed. Starting a trial or linking an account in the admin page saves one. For the component, set the SOCIAL_FEEDS_KEY secret (or SOCIAL_FEEDS_KEY_), for example with `npx wrangler secret put SOCIAL_FEEDS_KEY`. Optional, since the feed is public. Never ask the user to paste a key into a chat, and never put one in code or the repo. ## Plans - Site: $5 a month or $50 a year. 1 site, 1 feed per site, 8 posts per feed, updates hourly, no view limit. - Pro: $12 a month or $120 a year. 1 site, 5 feeds per site, 24 posts per feed, updates every 15 minutes, no view limit. - Agency: $39 a month or $390 a year. 15 sites, then $3 a month per extra site, 5 feeds per site, 50 posts per feed, updates every 15 minutes, no view limit. UK prices are the same numbers in pounds. 14-day free trial, no card, one per Instagram account. The lightbox (click: "lightbox") needs Pro or Agency. Local and staging addresses don't use a site. ## Troubleshooting - Nothing shows: open https://feeds.ninetysixsoftware.co.uk/api/feeds/. 404 means a wrong feed id. "posts": [] means Instagram isn't connected, or the trial or plan has ended. - A change doesn't show: the site keeps the feed 60 seconds (a save in the site's own admin clears it), and the service up to 5 minutes in other data centres. - Embed shows nothing on a new domain: the domain has to be in the feed's site addresses. - More: https://feeds.ninetysixsoftware.co.uk/help