Install SDK
11 min
start your ionic project using a pre built template introduction in this section you learn how to install parse javascript sdk into your ionic project see more about parse sdk at parse javascript sdk api reference https //parseplatform org/parse sdk js/api/4 3 1/ and parse open source documentation for javascript sdk https //docs parseplatform org/js/guide/ prerequisites to complete this tutorial, you will need an app created at back4app follow the new parse app tutorial https //www back4app com/docs/get started/new parse app to learn how to create a parse app at back4app an ionic project started follow the getting started https //ionicframework com/docs/intro/cli tutorial if you don’t have it set up 1 install sdk since ionic packages are managed by \<font color="#2166ae">npm\</font> , all you have to do is to run the following command at your project folder level $ npm install parse 2 connect your parse app import \<font color="#2166ae">parse\</font> in \<font color="#2166ae">home ts\</font> or in the page you want to make use of home ts 1 import parse from 'parse'; use \<font color="#2166ae">parse serverurl\</font> atrribute to set up the url for back4app parse server home ts 1 parse serverurl = 'https //parseapi back4app com/'; use \<font color="#2166ae">parse initialize\</font> method to set up the authentication token, connecting your page with back4app servers home ts 1 parse initialize("your app id", "your js key"); find your application id and your client key go to your app dashboard at back4app website navigate to app’s settings click on \<font color="#2166ae">server settings\</font> > \<font color="#2166ae">core settings\</font> block > \<font color="#2166ae">settings\</font> return to your parse initialize function and paste your \<font color="#2166ae">applicationid\</font> and \<font color="#2166ae">javascriptkey\</font> 3 test your conection create a test code test your initial setup with the following code which creates an \<font color="#2166ae">installation\</font> object first, go ahead and create a variable to show the result on your app \<font color="#2166ae">home\</font> page home ts 1 result string; next, display that variable on your \<font color="#2166ae">home\</font> view home html 1 2 {{result}} 3 finally, add the code that instanciates an \<font color="#2166ae">installation\</font> object and saves it add this piece of code after setting up the communication home ts 1 let install = new parse installation(); 2 3 install save(null, { 4 success (install) => { 5 // execute any logic that should take place after the object is saved 6 this result = 'new object created with objectid ' + install id; 7 }, 8 error (install, error) => { 9 // execute any logic that should take place if the save fails 10 // error is a parse error with an error code and message 11 this result = ('failed to create new object, with error code ' + error message tostring()); 12 } 13 }); run your app on your browser $ ionic serve 2\ wait until a new tab opens on your browser i n order to see the page in a phone frame, press \<font color="#2166ae">f12\</font> 3\ login at back4app website https //www back4app com/ 4\ find your app and click on \<font color="#2166ae">dashboard\</font> 5\ click on \<font color="#2166ae">core\</font> 6\ go to \<font color="#2166ae">browser\</font> if everything works properly, you should find a class named \<font color="#2166ae">installation\</font> as follows it’s done! at this point, you have learned how to get started with ionic apps