0.2.59 • Published 9 days ago

polyfire-js v0.2.59

Weekly downloads
-
License
MIT
Repository
-
Last release
9 days ago

Why use Polyfire?

  • Just code from the frontend, no backend needed
  • If you already have backend, less code to write
  • Most backend services you'd need in a couple lines of code

We manage your AI backend so you don't have to.

Demo Gif

🧰 Examples

We have several examples in our documentation. But here are two simple ones to get you started

React

import { useState, useEffect } from "react";
import { createRoot } from "react-dom/client";
import { TextGenerated, Login } from "polyfire-js/components";

function App() {
    return (
        <Login>
            <h2>Here's a little auto-generated haiku for you:</h2>
            <TextGenerated prompt="Generate a hello world haiku" />
        </Login>
    );
}

document.body.innerHTML = '<div id="app"></div>';
const root = createRoot(document.getElementById("app"));
root.render(
    <PolyfireProvider project="your_project_id">
        <App />
    </PolyfireProvider>,
);

Don't forget to change the your_project_id by your project ID you will have got on https://beta.polyfire.com

Vanilla JS

<script src="https://github.com/polyfire-ai/polyfire-js/releases/download/0.2.7/polyfire-min-0.2.7.js"></script>
<script>
    (async () => {
        const polyfire = window.PolyfireClientBuilder({ project: "your_project_id" });

        const isAuthenticated = await polyfire.auth.init();
        if (!isAuthenticated) {
            await polyfire.auth.login("github");
        }

        const helloWorld = await polyfire.models.generate("Write me a hello world haiku");
        console.log(helloWorld);
    })();
</script>

Don't forget to change the your_project_id by your project ID you will have got on https://beta.polyfire.com

🆕 Getting Started

To get an overview of Polyfire follow this Basic Usage tutorial.

✨ Starter Guides

We also made a couple of tutorials you can use to get started with Polyfire:

📚 Useful References

🔗 Links

We're open source! Make a good PR to the JS SDK or the API and we'll merge it.

0.2.59

9 days ago

0.2.58

2 months ago

0.2.57

3 months ago

0.2.56

3 months ago

0.2.55

3 months ago

0.2.54

3 months ago

0.2.53

3 months ago

0.2.52

3 months ago

0.2.51

3 months ago

0.2.50

3 months ago

0.2.49

3 months ago

0.2.48

4 months ago

0.2.47

4 months ago

0.2.46

4 months ago

0.2.45

4 months ago

0.2.44

4 months ago

0.2.43

4 months ago

0.2.42

4 months ago

0.2.41

4 months ago

0.2.40

4 months ago

0.2.39

4 months ago

0.2.30

4 months ago

0.2.38

4 months ago

0.2.37

4 months ago

0.2.36

4 months ago

0.2.35

4 months ago

0.2.34

4 months ago

0.2.33

4 months ago

0.2.32

4 months ago

0.2.31

4 months ago

0.2.29

4 months ago

0.2.28

5 months ago

0.2.27

5 months ago

0.2.26

5 months ago

0.2.25

5 months ago

0.2.24

5 months ago

0.2.23

5 months ago

0.2.22

5 months ago

0.2.19

6 months ago

0.2.18

6 months ago

0.2.17

6 months ago

0.2.16

6 months ago

0.2.15

6 months ago

0.2.14

6 months ago

0.2.13

6 months ago

0.2.12

6 months ago

0.2.11

6 months ago

0.2.10

6 months ago

0.2.9

6 months ago

0.2.8

7 months ago

0.2.7

7 months ago

0.2.6

7 months ago

0.2.5

7 months ago

0.2.4

7 months ago

0.2.3

7 months ago

0.2.2

7 months ago

0.2.1

7 months ago

0.2.0

7 months ago