npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@fosterai/api

v1.0.5

Published

Lightweight browser SDK for Foster AI integration

Readme

Package Documentation

This package provides several functions for working with Foster AI API functions.


1. fetchTranscription(IDToken, audio, vocab, statusCallback)

Description:
Transcribes the given audio file by calling the fosterTranscriptionAPI function.

Parameters:

  • IDToken (string): The authentication token required for the API call.
  • audio (File): The audio file to be transcribed. This should be a JavaScript File object (commonly produced using the MediaRecorder API) with an appropriate MIME type.
  • vocab (Object, optional, default: {}): A vocabulary object to improve transcription accuracy. Each key should represent an incorrect word with its corresponding value being the correct word.
  • statusCallback (Function, optional, default: () => {}): A callback function to receive status updates during the transcription process.

Returns:
A Promise<string> that resolves with the transcription text.

Throws:
An Error if the transcription fails after the maximum number of retries.

Usage Example:

fetchTranscription(token, audioFile)
  .then(transcription => {
    console.log("Transcription:", transcription);
  })
  .catch(err => console.error("Transcription error:", err));

2. fetchNote(IDToken, transcription, noteType, customNoteTemplate)

Description:
Generates a clinical note from the provided transcription by calling the fosterNoteAPI function.

Parameters:

  • IDToken (string): The authentication token required for the API call.
  • transcription (string): The transcription text to base the note on.
  • noteType (string, optional, default: 'SOAP'): The type of clinical note to generate (e.g., 'SOAP', 'clinical', or 'custom').
  • customNoteTemplate (Object, optional, default: {}): An optional custom template object to format the note.

Returns:
A Promise<Object> that resolves with the generated clinical note.

Throws:
An Error if note generation fails.

Usage Example:

fetchNote(token, transcription)
  .then(note => console.log("Clinical Note:", note))
  .catch(err => console.error("Note generation error:", err));

3. createEmailSignIn(email, password, enterpriseAPIKey)

Description:
Initiates the email sign-in process after verifying a shared enterprise API key.

Parameters:

  • email (string): The user's email address.
  • password (string): The user's password.
  • enterpriseAPIKey (string): The shared enterprise key to be verified via a backend call.

Returns:
A Promise<Object> that resolves with a user object containing user details and a getIdToken function to retrieve the ID token.

Throws:
An Error if the shared secret key is invalid.

Usage Example:

createEmailSignIn('[email protected]', 'password123', 'enterpriseKey')
  .then(user => console.log("Signed in user:", user))
  .catch(err => console.error("Sign-in error:", err));

4. emailSignIn(email, password, enterpriseAPIKey)

Description:
Signs in a user with their email after verifying the shared enterprise API key.

Parameters:

  • email (string): The user's email address.
  • password (string): The user's password.
  • enterpriseAPIKey (string): The shared enterprise key to be verified via a backend call.

Returns:
A Promise<Object> that resolves with a user object containing user details and a getIdToken function.

Throws:
An Error if the shared secret key is invalid.

Usage Example:

emailSignIn('[email protected]', 'password123', 'enterpriseKey')
  .then(user => console.log("Signed in user:", user))
  .catch(err => console.error("Sign-in error:", err));