Completing a Basic Contact Picker Installation

How to I complete a basic installation of the Contact Picker?

We've written a basic installation guide, as well as, created a walk-through video to help you integrate the Contact Picker. 



Basic Installation

Once you’ve created a CloudSponge account, you’ll get your own Snippet that you can add to any page to include our Contact Picker there. The snippet is a very basic example of using our contact picker on a page. There are three things that any Contact Picker integration must do:

  1. include your contact picker javascript,
  2. provide a way for the end user to launch the contact picker and,
  3. do something with the user’s contacts.

1. Add your contact picker script

Pro tip: your Contact Picker is totally customizable. Explore a few of the ways you can tailor it here.
Your CloudSponge key is the name of your own custom contact picker script. Add this script to the page that you would like to use the contact picker on.

<script src="https://api.cloudsponge.com/widget/KYKIAosnYYOPGimP0Pbh1A.js"></script>
<script type="text/javascript">
	cloudsponge.init({
		sources: ['gmail', 'yahoo', 'outlookcom', 'aol', 'icloud', 'office365', 'outlook', 'addressbook', 'mail126', 'mail163', 'bol', 'csv', 'gmx', 'mailcom', 'mail_ru'],
	});
</script>

You can add the script in the head or in the body of the page.

2. Launch the Contact Picker:

Launch the contact picker and let users pick a source from our UI:

<a href="#" class="cloudsponge-launch">Pick Contacts</a>

Or display your own “deep links” to launch directly to a specific address book:

<a class="cloudsponge-launch" data-cloudsponge-source="gmail">Google Contacts</a>

Read more about our linking options here.

3. Get the Contacts

After users pick their contacts, they will be populated inside an HTML element.

<input type="textarea" class="cloudsponge-contacts"/>

This is the pattern you’ll follow to get started with CloudSponge. You need to sign in to get your own Contact Picker Script:

<!DOCTYPE html>
<html>
<body>
<!--
Any widget integration must do three things:
1) include the widget script,
2) provide a way for the end user to launch the widget and,
3) do something with the user's contacts.
This basic integration does all.
-->
<!--
Include the script anywhere on your page, usually in the head
(don't forget to replace `localhost-only` with your CloudSponge key)
-->
<script src="https://api.cloudsponge.com/widget/localhost-only.js"></script>
<!--
#2 provide a way for the end user to launch the widget:
Any link with a class="cloudsponge-launch" will start the import process.
-->
<a class="cloudsponge-launch">Add from Address Book</a>
<!--
#3 do something with the user's contacts:
This textarea will be populated with the contacts returned by CloudSponge.
-->
<textarea class="cloudsponge-contacts"></textarea>
</body>
</html>
view rawbasic.html hosted with ❤ by GitHub

Internet Explorer Caveat

Please be aware of IE’s Protected Mode settings. Your test page and api.cloudsponge.com both need to be in zones with the same Protected Mode setting. Usually, api.cloudsponge.com is in the Internet Zone, and your localhost is in the Local internet Zone.

Our recommendation is to enable Protected Mode for both the Internet Zone and the zone that your test page is in. This ensures that your local environment behaves the same as in production.

This is not an issue in production since both sites are in the same IE zone and will be treated with the same Protected Mode.

    • Related Articles

    • How do I integrate the Contact Picker with Zapier?

      Watch the video and read the guide below to integrate the Contact Picker with Zapier. Zapier is a platform that lets you build automated workflows to connect 1000’s of web applications together, without needing to know how to write any code! We ...
    • Why isn’t Google Contacts showing up in my Contact Picker?

      By default, Google will not be in your Contact Picker until you start your Google OAuth project. We did this intentionally so as to not display errors to your site users. Once you start your OAuth project, Google will automatically appear in your ...
    • How do I install Better Sharing?

      There are two ways to install the Better Sharing plugin on your WordPress website. 1. Search and Install from the WordPress Plugin Menu. Go to: WP Dashboard > Plugins> select ‘Add New’ from the top of the page. Search the list using the keywords ...
    • Do I need to complete OAuth in order to use CloudSponge?

      While Yahoo, AOL, and Microsoft are optional (but highly recommended) Google OAuth must be completed before Google Contacts will show in your Contact Picker. Google has strict requirements that everyone must follow. Click here to learn more about ...
    • How can I approve my site after launching the Contact Picker?

      You need to go to your account and manually add the site to your sites section. Once you have done this, the site will be licensed and will work on your website. We're waiting to help at support@cloudsponge.com.