Sample code and templates

We have a shiny, new BEE Plugin technical docs site.
You can find a new version of this page here

 

Sample code: embedding the editor

Here is some sample code to get you and up running in no time.

 

Using the client-side example, you can literally try out BEE Plugin in 2 minutes...

  1. Download the client-side sample code: ClientSideImplementation
  2. Open clientSideImplementation/index.html with your favorite code editor
  3. Locate client_id and replace "YOUR_CLIENT_ID" with yours
  4. Locate client_secret and replace "YOUR_CLIENT_SECRET" with yours
  5. Save the file
  6. Open it in your browser and get creative (smile)

To obtain your Client ID and Client Secret sign up here (it's free).

 

Sample code: file system provider

You can connect BEE Plugin to your own file system (e.g. to let users of your app find images where they already exist).

Python (Django)

The file below is a file system provider API built in Python. It's based on Django and connects BEE Plugin to an Amazon Web Services S3 bucket.

BEE-Plugin-Django-FSP.tar

Other programming languages

Coming soon!

 

Sample templates

Download, collaborate, and contribute: https://github.com/BEE-Plugin/BEE-FREE-templates

 

Don't forget...

To use any of the sample code mentioned above you will need to first create an application on developers.beefree.io/signup (i.e. the application where the editor will be embedded) and obtain your application keys.

Here is an example of the application details page where the application keys are found.

Other important notes about using sample code

Before using the code samples listed above in a production environment, please consider the following:

  1. The client-side sample is not safe for a production environment (it was conceived as a quick way for you to test the application). Someone would be able to easily steal your application credentials (just viewing the source code of the page). To keep those credentials safe, authorization must be managed sever-side, as the .NET sample does.
  2. These code samples use a limited set of features and configurations: they can be a good starting point to start developing around BEE, but they are not an exhaustive showcase of everything you can do.
  3. All sample code is provided "as is": it may contain defects, it may not follow best practices (although we try to!), and it should only be considered as point of reference.
Have more questions? Submit a request

Comments

  • Avatar
    Guillermo Padilla

    Hi, you can add there the javascript that you need, that function must be provided by your application.

  • Avatar
    David, Liu

    Hello, I am working my FSP, and I have installed a project with JAVA code. When I integrate with beefree, I got the error message System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) . Any update for this? I cannot get detail message. I have compared the response with your definition, they are the same. I am pending on this for a long time. is there something I need to take care? such HTTP header ......

  • Avatar
    silas

    Hi Guys,

    I'm trying to add a save function outside the BeePlugin object.
    Can someone help me?

    This is what i tried, but the beeInstance is undefined;

    var beeInstance = null;

    // Call create method and pass token and beeConfig to obtain an instance of BEE Plugin
    BeePlugin.create(JSON.parse(token), beeConfig, function (beePluginInstance) {
    // Call start method of bee plugin instance
    if (data) {
    beeInstance = beePluginInstance;
    beeInstance.start(data);
    beeInstance.save();
    }
    });

    $('.bee-save').click(function(){
    beeInstance.save();
    });

  • Avatar
    silas

    fixed the previous post

    $(function (scope) {
    self = scope.beeFree = {};

    // Call create method and pass token and beeConfig to obtain an instance of BEE Plugin
    BeePlugin.create(JSON.parse(token), beeConfig, function (beePluginInstance) {
    // Call start method of bee plugin instance
    if (data) {
    self.beeInstance = beePluginInstance;
    self.beeInstance.start(data);
    self.beeInstance.save();
    }
    });

    $('.bee-save').click(function(){
    self.beeInstance.save();
    });

    });

    but here is my second question, trying to make a "save and close" button.
    How can i let the script wait untill bee finished saving before the closing happends?

    self.beeInstance.save()
    // wait until saving process finished
    beeCloseCallback();