![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
polyfire-js
Advanced tools
⚡ An all-in-one managed backend for AI apps. Build AI apps from the frontend, very fast. 🪶
Why use Polyfire?
We manage your AI backend so you don't have to.
We have several examples in our documentation. But here are two simple ones to get you started
import { useState, useEffect } from "react";
import { createRoot } from "react-dom/client";
import { PolyfireProvider, usePolyfire } from "polyfire-js/hooks";
function App() {
const { auth: { login, status }, models: { generate } } = usePolyfire();
const [haiku, setHaiku] = useState();
useEffect(() => {
if (status === "authenticated") generate("haiku").then(setHaiku);
}, [status]);
if (status === "unauthenticated")
return <button onClick={() => login("github")}>Login with Github</button>;
else if (status === "loading" || !haiku) return <h1>Loading...</h1>;
return <h1>{haiku}</h1>;
}
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
<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
To get an overview of Polyfire follow this Basic Usage tutorial.
We also made a couple of tutorials you can use to get started with Polyfire:
We're open source! Make a good PR to the JS SDK or the API and we'll merge it.
FAQs
🔥 polyfire
The npm package polyfire-js receives a total of 6 weekly downloads. As such, polyfire-js popularity was classified as not popular.
We found that polyfire-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.