17.10.2024

Easybeam SDKs: No Backend Needed

Easybeam SDKs: No Backend Needed

Overview

Easybeam's SDKs and API allows you to ship Ai features without building a backend to proxy the requests through, and gives you insight with powerful analytics and monitoring.

Background

Imagine this:

You're scoping out that cool new Ai feature for your app. You've time boxed the investigation, and it's seeming like it might actually be possible to build something in a reasonable time-frame. You see that the curl is relatively straight forward, so the rest should be a breeze.

When you're trying to integrate things into your app however, things start to take a turn for the worse. Your application framework (Flutter, Swift, React Native, etc) handles streaming strangely (they all do), and you just spent a few days debugging why the stream doesn't come in live.

You're already behind, but you think "screw it", and think about calling it good enough, and release a feature with broken streaming that connects directly to Open AI in your app. You've got a deadline, after all.

How bad could it be?

It's actually very, very bad.

Don't do this.

You can't ship an app that directly connects to OpenAI (or any open-ended Ai provider for that matter), because that would require shipping your OpenAI token in your application, which would be very bad. This would make your OpenAI access token visible to bad actors, who could then use your access token as their own, use up millions of your tokens, and cause fraudulent charges of potentially thousands of dollars.

A common solution to this is to "hide" your request to the Ai provider (OpenAI) behind an API, but this has problems in and of itself. Do you have to update your API every time you make a change? Do you have to make a new API every time you want to make a new AI feature? Is your backend response enough, or does it introduce a noticeable delay to your Ai feature? How're you handling streaming?

It's weirdly painful, and will suck time, money, and precious life force from you and your team.

Solution

We've seen these problems before, and sunk the time and money so that you don't have to suffer.

It's as easy as:

await easybeam.streamPortal( // or .streamWorkflow
  "B6wliK",
  user.id, // this comes from your system
  { animal: user.favoriteAnimal }, // placeholder for filling in variables
  messages, // this can be empty if you're doing a one-off, or populated as your user chats
  onNewMessage, // handle the new message
  onClose, // handle the stream ending
  onError // handle Open AI puking
);

When you use Easybeam, you can use one of our SDKs to plug Ai directly into your app — no backend needed. Not only did we figure out the intricacies of each platform's streaming requests for you (brutal), but we act as your scope-limited proxy for you, so don't have to waste time with setting up extra services to support your features.

When you interact with Easybeam, you'll be doing so with either a Portal or Workflow Id. These Ids limit the scope of the interaction to a single source of truth that you manage on our web-app. This means that your Easybeam access token can be published directly in your app, without fear of open-ended abuse.

Plus with our Logs, Analytics, and Security, we make it easy to ban bad-actors and folks trying to abuse your system.

We also do all that other stuff like give you a no-code tool for prompt chaining, prompt management, automated tests, etc etc etc, but that's a story for another time.

Keep your app safe, and build something that users want faster than your competitors can.

Use Easybeam.

Have any more questions? Just shoot us a message on intercom (best), or reach out to hello@easybeam.ai

Stay in the loop

Get the occasional insights on what's going on with "the machines are taking over" straight to your inbox.

Follow us

Copyright easybeam © 2024. All Rights Reserved

Knowledge

Status

Documentation

Security

Cookies

Privacy Policy

Terms & Conditions

Stay in the loop

Get the occasional insights on what's going on with "the machines are taking over" straight to your inbox.

Follow us

Copyright easybeam © 2024. All Rights Reserved

Knowledge

Status

Documentation

Security

Cookies

Privacy Policy

Terms & Conditions

Stay in the loop

Get the occasional insights on what's going on with "the machines are taking over" straight to your inbox.

Follow us

Copyright easybeam © 2024. All Rights Reserved

Knowledge

Status

Documentation

Security

Cookies

Privacy Policy

Terms & Conditions

Stay in the loop

Get the occasional insights on what's going on with "the machines are taking over" straight to your inbox.

Follow us

Copyright easybeam © 2024. All Rights Reserved

Knowledge

Status

Documentation

Security

Cookies

Privacy Policy

Terms & Conditions