0.1.1 • Published 12 months ago

@firebase-studio/open-sdk v0.1.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
12 months ago

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:

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': '...',
    }
  });
};
0.1.1

12 months ago

0.1.0

1 year ago