Skip to main content

Sample Apps

Our Sample Apps are available to assist you in beginning to build your first App. Our Sample Apps include many of the functions you'll need to use in your App, and allows you to get up and running within minutes.

We have a boiler plate setup that provide a working baseline for the look and feel of the App stream, plugin, and content source extensions. The Sample App works out of the box - just follow the instructions provided on Github to host and deploy the App. Additional information regarding our Sample Apps can be found below.

Stream Extension
Download this Stream Extension Template we've created that shows how elements and class name should be used in order to maintain a consistent UI experience across Hootsuite.

Instructions to create an App Stream are here

Plugin Extension
Instructions to create an App Plugin are here

Content Source Extension
Instructions to create a Content Source Extension are here

Deploy the App​

You can either setup your app to run locally or deploy it to an externally hosted server such as Heroku. Note: Both options will need a secured https connection.

Prep app for server​

In order for your localhost server or Heroku to know where to look in your app, you will need an index.php (for php app) file that points to the entry point into your app.

Create a new file within the Hootsuite Demo App directory called index.php. Open any text editor of your choice and insert this line of code and save the file:

<?php include_once(“you_apps_page.html”); ?>

Heroku​

The easiest way to get an app up and running is to create a Heroku account. This is not the quickest way to test updates to your app.

1. Create Heroku App
The easiest way to get an app up and running is to create a Heroku account. Once you have an account you will have a few free apps that you can create. Click on new app and pick a name for your app.

2. Install Heroku Command Line Interface(CLI)
Install the Heroku CLI following these instructions.

3. Deploy to App
You’ve created the app, now you want to deploy that Hootsuite Demo App to the Heroku hosted app so you can access the app from anywhere. Open a command terminal, navigate to your Demo App's directory and run the following,

Initiatlize your repo so you can use git to sent to Heroku
$ git init
Login to Heroku account
$ heroku login
Enter Heroku account credentials
myHerokuApp@somedomain.com
myPassword
Connect to the new app you just created
$ heroku git:remote -a <mysampleapp>
Add and commit all the files you want to send to Heroku
$ git add -A
$ git commit -m "my commit message"
$ git push heroku master
You should now see your live app at something like, https://mysampleapp.herokuapp.com

Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 574 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote: NOTICE: No runtime required in composer.lock; using PHP ^5.5.17
remote: - apache (2.4.20)
remote: - nginx (1.8.1)
remote: - php (5.6.30)
remote: -----> Installing dependencies...
remote: Composer version 1.2.4 2016-12-06 22:00:51
remote: -----> Preparing runtime environment...
remote: NOTICE: No Procfile, using 'web: vendor/bin/heroku-php-apache2'.
remote: -----> Checking for additional extensions to install...
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 13.7M
remote: -----> Launching...
remote: Released v25
remote: https://mysampleapp.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy.... done.
To https://git.heroku.com/mysampleapp.git
6b345bb9..d5236f7 master -> master

Localhost​

The alternative route to get an app up and running is to setup a local server. More setup is required but any changes to your code locally will not need to be pushed to Heroku and will be quicker.

In order for your deployed app to run within Hootsuite, you'll need to insert your app's URL into a Hootsuite app. Navigate to My Apps and create a new app with a Stream extension if you haven't already done so. Within the Stream extension, insert the URL into the iFrame URL input. Save and install it. Now you should be able to see your app live within your Hootsuite dashboard and also be able to access all the native functions.