Empire Cloud ▾
App Building Kit

Inspect the App Building Kit

A license gives access by invitation to the private Python repository. Both editions point to the same files.

Personal and Team licenses

EditionOne-time priceDelivery
Personal$99License key and repository invitation
Team$399Team license key and repository invitation

The pack terms grant non-exclusive use under a non-transferable key. Distribution outside your organization is prohibited. The published Team terms leave seat count and the duration of updates unspecified. Confirm license scope and updates before buying.

Example project

This Python example creates a preview, saves it to a test account and reopens it through the signed-in session. A second browser must sign in to see the saved work. The kit supplies the Flask account-saving module. Hosted EliteSSO needs a separate integration.

Inspect the account example
"""Run with python account-demo.py after installing the kit, Flask-Login and Flask-SQLAlchemy."""
import secrets
from pathlib import Path
from tempfile import TemporaryDirectory
from flask import Flask
from flask_login import LoginManager, UserMixin
from flask_sqlalchemy import SQLAlchemy
from empire_app_kit.anonymous import register_preview
from empire_app_kit.save import register_save

def run_example(directory):
    app = Flask(__name__, instance_path=directory)
    app.config.update(SECRET_KEY=secrets.token_hex(32),
                      SQLALCHEMY_DATABASE_URI='sqlite:///' + str(Path(directory)/'accounts.db'))
    db = SQLAlchemy(app)
    login = LoginManager(app)

    class User(UserMixin, db.Model):
        id = db.Column(db.Integer, primary_key=True)
        email = db.Column(db.String(120), unique=True, nullable=False)
        password_hash = db.Column(db.String(256), nullable=False)

    @login.user_loader
    def load_user(uid):
        return db.session.get(User, int(uid))

    with app.app_context():
        db.create_all()
    register_preview(app, lambda prompt: 'Project: ' + prompt)
    register_save(app, db, User)
    browser = app.test_client()
    first = browser.post('/api/preview', json={'prompt':'Sample notebook'})
    assert first.status_code == 200
    saved = browser.post('/api/preview/save', json={'token':first.json['save_token'],
                         'email':'builder@example.org', 'password':secrets.token_urlsafe(20)})
    assert saved.status_code == 200 and saved.json['saved']
    library = browser.get('/my-previews')
    assert library.status_code == 200 and b'Sample notebook' in library.data
    guest = app.test_client().get('/my-previews')
    assert guest.status_code in (302,303)
    print('Preview created. Saved to the test account. A new browser must sign in.')

if __name__ == '__main__':
    with TemporaryDirectory() as directory:
        run_example(directory)

Download the example. With the kit installed alongside Flask-Login and Flask-SQLAlchemy, run python account-demo.py. The example uses a temporary SQLite database and a fictional identity.

Delivered files

Repository revision 7c38f1749a26. The file list below was read from the revision supplied for both editions.

Return to pricing