@firebase-studio/open-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Open in Firebase Studio SDK

A JS library for opening workspaces in Firebase Studio.

Installation

npm install @firebase-studio/open-sdk

Usage

For all the examples below, after installing the SDK, import the package:

import * as FirebaseStudio from '@firebase-studio/open-sdk';

Button images

Get a URL to a CDN-hosted "Open in Firebase Studio" button image:

img.src = FirebaseStudio.getButtonImageUrl({
  // optional config
});

Example:

Open in Firebase Studio button

Deep-link URLs

You can get a deep link into Firebase Studio for a variety of destinations, e.g.:

link.href = FirebaseStudio.getOpenUrl({
  type: 'named-template', // or 'git', etc
  templateId: 'gemini'
});

Ad-hoc workspaces

In a browser environment, you can create an ad-hoc workspace from an arbitrary set of project files like so:

button.onclick = () => {
  FirebaseStudio.newAdhocWorkspace({
    files: {
      'index.html': '<h1>hello world</h1>',
      '.idx/dev.nix': '...',
    }
  });
};

Package Sidebar

Install

npm i @firebase-studio/open-sdk

Weekly Downloads

11

Version

0.1.1

License

Apache-2.0

Unpacked Size

21.3 kB

Total Files

6

Last publish

Collaborators

  • romannurik
  • _davideast