Only this pageAll pages
Powered by GitBook
1 of 19

1.0

Loading...

Tutorials (Learning)

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Reference (Information)

Loading...

Loading...

API Modules

Loading...

Contributing

Loading...

Loading...

Loading...

Support

Loading...

Start Your Frigg App

Ready to see Frigg in action? Let's start it up!

Make sure you're in the root directory of your application, then use:

npm run start

Your browser should open to http://localhost:3000 and you should see your Login screen.

Before you continue, make sure that both your frontend and backend are running. An easy way to know is to check if your terminal looks something like this:

If your terminal shows that the backend is also running, you can now experience with your app as an end-user and connect it to see live data coming through!

Configuration

We've streamlined the setup process to make it as smooth as possible. We've pre-configured several environment variables that apply universally to all Frigg users upon installation. All that's left for you to do is to add your personal HubSpot credentials to connect to your app:

Set up your HubSpot App

To add your HubSpot credentials, open the .env file located in backend/*.env with your IDE and have it ready to paste the information we'll gather in the next steps.

Go to your HubSpot account and create a new HubSpot App, and explore HubSpot if you're not familiar with it. Inside your HubSpot App, head to the "Auth" Tab, next to "App Info," where your can find your app settings.

Now copy your Client ID and Client Secret into the HUBSPOT_CLIENT_ID and HUBSPOT_CLIENT_SECRET fields in the .env file. In the same file, add oauth to the HUBSPOT_SCOPE array.\

In HubSpot's tab, click the +Add new scope button, search for and add the scopes listed in your .env file.

Next, under the "Redirect URLs" section in the "Auth" tab, add http://localhost:3000/redirect/hubspot as a redirect URI.

Save your changes in both the .env file and HubSpot Auth settings.

Finally, from HubSpot's Developer home, create a new developer test account. This will prepare your app for integration and testing.

With all these settings configured, you're now ready to start your Frigg application.

Welcome to Frigg!

Developing integrations as easy as `npm install`

Welcome to Frigg Framework Documentation. Frigg is an open source serverless framework for developing integrations at scale. This documentation will help you get started with Frigg, understand its core concepts, and contribute effectively.

"TLDR, let me get my hands into the code!" ~ You, maybe

For our thorough readers, read on!

Integrations shouldn't be that hard to build and maintain...

Frigg was built with the core principles that user-facing self-serve software integrations should be:

  • Easy to Develop

  • Inexpensive to run

  • Modular and Extensible

  • Easy to Scale

  • Easy to maintain

This is our answer to the question "hasn't this already been done before?"

Modern stack; easy to understand; fast to develop and deploy; comprehensive enough to cover any use case; fully open source. Interoperability, the way it should be.

Navigating the Docs

These docs should be your go-to resource for all things Frigg related. Secondary are GitHub READMEs and Slack community channels.

In general, there are four main areas of the docs, and four supplemental sections

Main Documentation Areas

Supplemental Documentation Areas

Before you go any further, some quick FAQs

How does Frigg define "Integration?"

Application Programming Interfaces (APIs) are everywhere in software development. They can be made for SDKs, hardware, internal modules, HTTP requests to external systems, and more.

Frigg is focused on building integrations between separate software systems, powered the majority of the time via HTTP APIs.

An integration, then, is the code that is used to "glue" these APIs together; an integration record is state managed by the software to keep track of which accounts and what settings a user desires.

At it's core, Frigg is intended to help developers build all types of integrations. And as we grow our footprint and community, we are undoubtedly going to see support added for enhanced features depending on your type of integration.

To start, however, our roadmap and framework is focused on one specific use case - software teams building native integrations to external systems for end-user integration. In a phrase: rapidly enabling technology partnerships.

Who is Frigg For... Internal Integrations? Powering your Software? Enabling your Users?

There are three potential use cases for Frigg that we currently use internally at Left Hook.

  • Internal Business Process Automation- This is the kind where you get notifications from GitHub to your Slack account; or where you have a cron job that every week summarizes and creates a report in Google Sheets, and emails out to relevant audiences; really, anything to help your backoffice flow smoother. This is squarely in the realm of iPaaS tools today. The primary audience for these integrations are internal users of your organization.

  • Product and Productized Service Automation- We view these as integrations that are powering your own software or service. Twilio integration to send text message alerts whenever a given event happens in your app. Webform piping to a database kicking off a drip campaign in your onboarding tool. Project completion kicking off an invoice to your clients with a summary of hours spent to date pulled from your time tracking software. There's a potential overlap with the first category, but it's most helpful to think of integrations to tools that eventually impact end users/customers of your software or service.

  • End User Integration Enablement- These are the integrations powering technology partnerships. Allowing users to connect their Slack account to your app, or their HubSpot account, or their Salesforce account, or go on down the line. By doing so, they adopt prebuilt workflows and automations that you've product managed to optimize the "better together" experience.

Should you desire to use Frigg for each of these, we recommend creating 3 separate Frigg applications, as each one has a different user base, compute needs, and risk profile.

For now, it's critical to call out that Frigg is focused on the last bucket- End User Integration Enablement. Frigg is focused on powering your integration directory, and power the integrations your users choose to enable and configure.

Over time, there will be documentation and features focused on the other two buckets. So keep an eye on this space! But keep that in mind as you read on.

Frigg Explained to Partnership Leaders & Non-Technical People

The Frigg Integration Framework is a software development tool intended to help engineers build integrations faster.

While we all know that new "tech partnerships" unlock business opportunities, integration development is a complex, product-driven process performed by engineers and designers. Partnership leaders can't conjure new integrations into existence; product & engineering resources must be engaged and supported.

Meanwhile, Frigg's documentation site is targeted at engineers and product leaders who will need to understand the framework as a development tool.

Frigg: What's in a name?
  • Frigg is Odin's wife in Norse mythology

  • Goddess of marriage and partnerships

  • She flies the earthly skies as a falcon

  • She is known in folklore as the “weaver of clouds”

The Frigg Integration Framework powers integrations between software companies, the majority of which are in the cloud, speeding up time to live on tech partnerships.

Frigg Explained to Developers

Frigg is the framework you would have built to develop integrations, if you had unlimited resources and time. The added difference is the promise of Open Source-- i.e. a community of developers collaborating to solve the same core set of problems over and over again. This is something you could never do internally.

The Frigg Framework is an opinionated set of development tools, modules, classes, and plugins built with modern software development teams in mind. Frigg will have you up and running out-of-the-box with a flexible set of tools to help rapidly add integrations that your end users can self-serve.

Frigg handles integration listing, authentication, and configuration out-of-the-box, built on a scalable serverless architecture. It includes a growing library of prebuilt API Modules to greatly reduce time to "wow." Along with the core "out of the box" features, the framework contains primitives to help address and flex to any use case.

A Note on Basic Architecture

A Frigg Application is predominantly a backend microservice, with an optional frontend. Most Frigg adopters already have an existing frontend UI built using a framework of their choice, or will bake integration UX into their product's core code. Frigg ships with a simple library of components to get you started quickly. See more details about frontend options here.

In the backend, Frigg is based on the serverless.com framework. This key piece of technology and the underlying compute/architecture under the hood provides a number of advantages:

  • Infrastructure-as-Code- The need to manually configure resources on the host provider is greatly reduced

  • Deployable to your favorite host- AWS, GCP, Azure, any a list of many more are available

  • Horizontal Scalability

  • Pay as you go

Sure, we hear you.

We are attempting to embrace a approach to documenting Frigg. Any recommendations are welcome!

Given these dynamics, partnership leaders often seek external vendors and tools to get integrations built. This search brings them to Frigg and .

Before you introduce Frigg to your engineering colleagues, partnership leaders should understand Frigg at a non-technical level. Our is intended to provide this context and support your internal advocacy for Frigg.

If you're ready to introduce Frigg to your technical colleagues, share this documentation site. Our is also instructive to both technical and non-technical audiences as well.

Have questions? Let's !

Read more about Frigg on .

Check out our Quick Start tutorial.
Diátaxis
Left Hook
Non-Technical Overview Doc
live demo site
connect
Wikipedia

Core Concepts

Understanding these core concepts will help you get the most out of the Frigg framework:

Integration

Extends @friggframework/integration-base. An "integration" is how Frigg connects (usually 2) modules for the connection of data and actions. Each service has its own API Module to represent its API to the middleware; use case-specific business logic will also be required.

API Module

Composed of an API Class (generally extending a subclass of @friggframework/requester) and a Module Definition. The API Class handles the requests to external APIs, i.e. authentication, identification, and data retrieval. The Module Definition lets the @friggframework know how to use this API Class as an API Module, such that tokens and other metadata the connection to an external api, can be stored (and refreshed).

Entity (authorizing entity)

A mongoose model extending @friggframework/module-plugin/entity: For a given API Module, the entity is a kind of handle, linking to the relevant credentials, and storing metadata about who/what is authorizing. Retrieving these for a given user is an important gateway to accessing an integration, as most integration actions require one or more authorized API Modules. Most generally, an API Module will be instantiated by passing in an Entity.

Credential

A mongoose model extending @friggframework/module-plugin/credential: For a given API Module, the credential generally stores the tokens or data necessary for making authenticated requests. Multiple Entities can reference the same credential, although 1:1:1 User:Entity:Credential is common.

Data Handling

Frigg manages data securely and efficiently, ensuring it can scale as needed without compromising performance.

Customization

Frigg is highly customizable, letting you tailor modules and integrations to fit your specific needs.

Testing

Frigg supports automated testing with tools like Jest to maintain reliability and performance.

Contribution

Frigg is open-source and thrives on community contributions. Whether you're fixing bugs, writing documentation, or developing new modules, your input is valuable. We encourage users to get involved through our GitHub repository, participate in discussions, and submit pull requests. Every bit of help makes Frigg better for everyone.

Connecting and Seeing Live Data

If you haven't already, select the "Create account (demo user)" option from the Login menu. A new user will be created for you with the pre-populated data you see on screen.

After receiving a successful confirmation message, you're now able to log in as the Demo User.

You will see a directory with HubSpot as an available connection.

Click on the "Connect" button and complete HubSpot's authorization flow.

When finished, you should see a connected HubSpot card. Now it's time to see your app in action with live data from HubSpot!

"No Data Available" error

Select "Get Sample Data" from the HubSpot app dropdown menu to see live data fetched from your test account.

Note that you might receive a "No data available" message. This is totally normal, given that we didn't add any info to your HubSpot account. There's nothing for our integration to fetch (yet).

Adding Test Data to HubSpot

To fix this, let's add some test data to your HubSpot account. From your HubSpot dashboard, you should go to the "Deals" section in the CRM menu.

Click "Create Deal" to manually add details and save, or use the "Import" option to upload a CSV file with test data.

Once you've added test data, refresh the page and select "Get Sample Data" again. Now you should see Deals data displayed in your app. This confirms that everything is connected and working correctly!


And that’s it! You’ve successfully created and configured your Frigg app with HubSpot. Time to explore and have fun with your new setup!

Initialize with Create Frigg App (CFA)

Use npx to Create the App

Open your terminal and cd to a location where you want to install your Frigg application. Then run the following command to create a new Frigg app, replacing [my-app-integrations] with your desired app name:

npx create-frigg-app [my-app-integrations]

Note on naming: We recommend naming your Frigg app something descriptive that reflects its purpose as a microservice that powers integrations; For example, "my-app-integrations" is a good fit.

This process might take a couple of minutes to complete, but at the end of it you should see something like this in your terminal:

During the installation process, you will likely encounter warnings related to deprecated dependencies and Git initialization errors. These warnings are expected and will not impact your ability to run Frigg successfully. We are working to resolve any/all warnings, but we do not believe they indicate any acute security or functionality concerns. If you have any concerns, please contact us.

Now navigate to your newly created app directory using the following command:

cd [my-app-integrations]

Congrats! You've just successfully scaffolded and installed your Frigg app. Continue with further configuration and customization.

Quick Start Tutorial

Getting Started

Aloha! Ready to dive into using Frigg? Let’s get a HubSpot integration (or what HubSpot calls an "app") up and running quickly. This exercise will guide you through setting up a Frigg app locally, integrating it with HubSpot, and experiencing the magic in real-time.

IMPORTANT: Running Create Frigg App requires several software development packages to be installed locally on your computer. While each prerequisite tool is fairly easy to install and configure, you may want to have an engineer available for troubleshooting.

Prerequisites

Before we start, make sure you have:

  • Your favorite IDE installed and ready to use

Overview

Running the create-frigg-app command will generate a Frigg application that is deployable to your own infrastructure accounts in minutes.

Let's get started with Create Frigg App and unpack the magic as we go.

What is HubSpot and why use it in this tutorial?

HubSpot is a popular marketing and CRM tool that helps businesses manage customer interactions. In this exercise, we use HubSpot to demonstrate how your Frigg App connects with external APIs. Setting up a HubSpot app lets you see how to connect, authenticate, and pull data from an external service. HubSpot provides an easy way understand integration basics in a common context.

For more detailed instructions on how to add test data, visit the .

Be sure to double-check that you have all the before attempting this tutorial.

installed

and running on your machine

A

HubSpot documentation
prerequisite tools installed
Your Dashboard in Frigg with the HubSpot Integration Available for Testing
Oops! Looks like we forgot to add some test data to HubSpot
You can find the Deals section inside the CRM menu
We see you, Antique Star Wars Droids collection!
Your terminal once Create Frigg App is completed
Node.js and npm
Git installed
Docker installed
HubSpot Developer Account
Cover

Hands-on activities to learn how to use Frigg, and how to think about and build high quality integrations.

Cover

In-depth directions for achieving different integration goals with Frigg, both general and on specific app/integration marketplaces.

Cover

Technical definitions for all things Frigg. Classes, Objects, Methods, APIs, and more

Cover

Here you'll find our thought processes for building Frigg the way we have, and for how we think about integration development

Cover

Documentation for each API module published in Frigg's main library.

Cover

All things contributing to Frigg from as little as a typo-fixer to as deep as a core maintainer.

Cover

Notes about how to get support

Cover

The short, medium, and long term features and opportunities roadmap for Frigg

Updating the Integration Logic

Now that your Frigg app is installed fresh out-of-the-box and your data is returning from your connected HubSpot account, let's pull data from another section within the same HubSpot account.

Roll up your sleeves- now it’s time to get your hands in the code and customize your integration.

Getting Started

Open your Frigg app project in your IDE. In the backend folder, look for the /src/integrations directory and open your HubSpotIntegration.js file.

Understanding HubSpotIntegration.js

This file is where all the integration magic happens. It tells Frigg which API modules should be connected to use the integration and contains all of the integration logic. Here’s a simple breakdown:

  • API Modules: Specifies which API modules are part of the integration.

  • Display Information: Defines the display (description, label, categories, etc.) for the frontend.

  • Lifecycle Event Handlers: Provides code/handlers for the lifecycle events of the integration (onCreate, onUpdate, onDelete).

  • Configuration Options: Determines what users can configure for the integration (getConfigOptions).

  • Event Handlers: Expands on the events that should trigger flows in the integration and defines handlers for those events.

  • User Actions: Defines user actions available for leveraging the integration.

The power of this file lies in its ability to manage all aspects of the integration from a single point of entry. This allows for quicker development and easier maintenance.

Swapping the Data Source

In the HubSpotIntegration.js file, find the getSampleData method. This is where the backend route fetches the data to display in the frontend. Update the code inside to fetch data from HubSpot’s "Companies" instead of "Deals" by replacing the original code with the following and saving the changes:

To apply these changes, restart your Frigg app by terminating the backend process (command or ctrl & C) and running:

This ensures the Frigg app backend service is updated with the new data fetching logic.

Testing Your Changes

Go to your HubSpot account and add some company data manually or by importing a CSV file. For detailed steps, refer to the Connecting and Seeing Live Data section. Now refresh your app to see the new data displayed.


Obviously, this is just a small change to the existing integration logic, not a fully fledged new feature. But one small change to the code has the potential to make a big impact for your integration users. Feel free to keep editing and exploring to get a feel for how simple it is to modify your existing integration logic, or check out our more advanced guides and tutorials to add more robust features.

In our next section, we'll show how easy it is to get up and running with a fully new integration.

Overview

API Modules are the Lego bricks that make Frigg-powered integrations develop faster. An API Module is the code that wraps your target partner's API and represents that API back to Frigg.

Frigg's API Modules are available for free under the MIT license. Translation: if your target partner's logo is in this library already, Frigg just saved you many hours of work.

Tutorials (Learning)

How-To Guides (Goals)

Reference (Information)

Explanation (Understanding)

API Modules

Contributing

Support

Roadmap

.

Read our reference doc.

async getSampleData() {
        const res = await this.target.api.listCompanies()
        console.log(res.results.length)
        const formatted = res.results.map(company => {
            const formattedCompany = {
                id: company.id,
                createdAt: company.createdAt,
                ...company.properties
            }


            return formattedCompany
        })
        return {data: formatted}

    }
npm run start
🧑‍💻
✅
📖
💭
🔌
🤝
📞
🗺️
View our library of v1-ready API Modules
API Module Definition and Functions

Contact

We have two ways to interact with Frigg's maintainer team:

1.

2.

Github Discussions, the official Frigg message board
Invite yourself to the Frigg Community Slack Channel

Contributor Covenant Code of Conduct

Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

Our Standards

Examples of behavior that contributes to a positive environment for our community include:

  • Demonstrating empathy and kindness toward other people

  • Being respectful of differing opinions, viewpoints, and experiences

  • Giving and gracefully accepting constructive feedback

  • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience

  • Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

  • The use of sexualized language or imagery, and sexual attention or advances of any kind

  • Trolling, insulting or derogatory comments, and personal or political attacks

  • Public or private harassment

  • Publishing others' private information, such as a physical or email address, without their explicit permission

  • Other conduct which could reasonably be considered inappropriate in a professional setting

Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

1. Correction

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

2. Warning

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

3. Temporary Ban

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

4. Permanent Ban

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

Attribution

This Code of Conduct is adapted from the , version 2.1, available at .

Community Impact Guidelines were inspired by .

For answers to common questions about this code of conduct, see the FAQ at . Translations are available at .

Contributor Covenant
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
Mozilla's code of conduct enforcement ladder
https://www.contributor-covenant.org/faq
https://www.contributor-covenant.org/translations

Overview

Frigg began as many products and open source projects do- a group of developers trying to solve their own or their clients needs saw common patterns and wanted to memorialize and publish the code they were re-using across projects.

As such, the first few years of Frigg development were largely driven by client projects needs, and we (Left Hook) were only able to move Frigg along in between critical paths for those individual projects. So, we're still working out the kinks in inviting contributing developers.

If you find something you need fixed:

  • Go to the relevant repo (Core, API Module Library, Example Apps, Create Frigg App, etc.)

  • Create a branch or fork from main

  • Make your tweaks

  • Submit a PR

Someone from the core maintainer team will review your code and ask questions where needed, as well as provide some guidance if any additional guidance is warranted.

There will be many more instructions in the coming months, especially as we ramp up the ability for folks to add their own API Modules to the mix, or other Frigg Adapters and Extensions.

As always, just ask, and we'll be happy to chat!

PULL_REQUEST_TEMPLATE

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.

  • All new code requires tests to ensure against regressions

Description of the Change

Alternate Designs

Benefits

Possible Drawbacks

Applicable Issues

Login screen of your Frigg app
Console log displaying the backend server being "ready" on localhost:3001
The terminal output shows the backend server running locally, with a list of active routes and endpoints available for testing and development
HubSpot's Auth tab for your app
Your scopes should look like this after adding them
Here you can set up your redirect locations

API Module Definition and Functions

Module Definition

const API = require('./api');
const authDef = {
    API: API,
    getName: function() {return config.name},
	   moduleName: config.name,
    requiredAuthMethods: {
        // oauth methods
        getToken: async function(api, params) {},
        // for all Auth methods
	 apiPropertiesToPersist: {
            credential: ['access_token', 'refresh_token'],
            entity: []
        },
        getCredentialDetails: async function(api) {}, 
        getEntityDetails: async function(api, callbackParams, tokenResponse, userId) {},
        testAuthRequest: async function() {}, // basic request to testAuth
    },
    env: {
        client_id: process.env.HUBSPOT_CLIENT_ID,
        client_secret: process.env.HUBSPOT_CLIENT_SECRET,
        scope: process.env.HUBSPOT_SCOPE,
        redirect_uri: `${process.env.REDIRECT_URI}/an-api`,
    }
};

getToken

For OAuth2, this function typically looks like this:

const code = get(params.data, 'code'); 
 await api.getTokenFromCode(code);

The getTokenFromCode method will make the token request and set the token on the API class.

apiPropertiesToPersist

Named arrays of properties to persist on either the entity or credential. Upon API class instantiation, these will be retrieved from the entity/credential and passed into the API class. Typically, the entity won't need to store anything, and the credential will suffice to persist tokens and other connection metadata.

getEntityDetails

Retrieve and return details about the user/organization that is authorizing requests to this API. Should return something like:

 const userDetails = await api.getUserDetails();
return {
        identifiers: { externalId: userDetails.portalId, user: api.userId },
        details: { name: userDetails.hub_domain },
}

The identifiers define the uniqueness of the entity and how it is looked up. It will automatically be linked to the created credential.

getCredentialDetails

Similar to getEntityDetails, returns:

 const userDetails = await api.getUserDetails();
return {
        identifiers: { externalId: userDetails.portalId },
        details: {}
};

Generally, the entity is looked up first, and the credential is found through that reference.


The entity and credential details functions require the most knowledge of Frigg Framework, and a deeper understanding of how authentication is handled by the external API. In the case where the external API has user accounts, and tokens per user (vs app or organization tokens), the externalId should likely be the user's id in that system (or their email, or whatever unique info can be retrieved).