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

@umituz/react-native-ai-fal-provider

v1.0.4

Published

FAL AI provider for React Native - implements IAIProvider interface for unified AI generation

Downloads

415

Readme

@umituz/react-native-ai-fal-provider

FAL AI provider service for React Native applications. Provides client wrapper, error handling, and React hooks.

Installation

npm install @umituz/react-native-ai-fal-provider @fal-ai/client

Usage

Initialize the Client

import { falClientService } from "@umituz/react-native-ai-fal-provider";

falClientService.initialize({
  apiKey: "YOUR_FAL_API_KEY",
  maxRetries: 3,
  defaultTimeoutMs: 300000,
});

Using the Hook

import { useFalGeneration } from "@umituz/react-native-ai-fal-provider";

function MyComponent() {
  const { data, error, isLoading, generate, retry } = useFalGeneration({
    timeoutMs: 120000,
    onProgress: (status) => console.log("Progress:", status),
    onError: (error) => console.log("Error:", error),
  });

  const handleGenerate = async () => {
    await generate("fal-ai/flux/dev", {
      prompt: "A beautiful sunset",
      image_size: "landscape_16_9",
    });
  };

  return (
    // Your UI
  );
}

Direct Service Usage

import { falClientService } from "@umituz/react-native-ai-fal-provider";

const result = await falClientService.subscribe("fal-ai/flux/dev", {
  prompt: "A beautiful sunset",
});

Error Handling

import { mapFalError, isFalErrorRetryable } from "@umituz/react-native-ai-fal-provider";

try {
  await falClientService.run("fal-ai/flux/dev", { prompt: "test" });
} catch (error) {
  const errorInfo = mapFalError(error);
  console.log("Error type:", errorInfo.type);
  console.log("Message key:", errorInfo.messageKey);
  console.log("Retryable:", errorInfo.retryable);
}

API

falClientService

  • initialize(config) - Initialize the client with API key
  • subscribe(endpoint, input, options) - Subscribe to generation job
  • run(endpoint, input) - Run a generation job
  • submitJob(endpoint, input) - Submit a job to queue
  • getJobStatus(endpoint, requestId) - Get job status
  • getJobResult(endpoint, requestId) - Get job result
  • isInitialized() - Check if client is initialized
  • reset() - Reset the client

useFalGeneration Hook

  • data - Generation result
  • error - Error info if failed
  • isLoading - Loading state
  • isRetryable - Whether error is retryable
  • generate(endpoint, input) - Start generation
  • retry() - Retry last generation
  • reset() - Reset state

Error Utilities

  • mapFalError(error) - Map error to FalErrorInfo
  • isFalErrorRetryable(error) - Check if error is retryable
  • categorizeFalError(error) - Get error category

License

MIT