Manage Integrations section makes your app possible to interact with many third-party systems/platforms by integrating them into your app back-end (brainCloud).
From Manage Integrations page, you can:
Streaming events data to your Segment data source.
Streaming events data to your Apache Kafka Topic.
Integrating SAML for end-user authentication.
Sending error alters and daily reports to your Slack channels.
Sending custom rich-text emails with your SendGrid account.
Controlling profanity with your WebPurify configurations.
To get started, find the Manage Integrations page on the brainCloud portal.
Segment Integration
Segment is a customer data hub. Your app can send your Segment account information about your users and their activity, and you can pipe this data to hundreds of tools for analytics, marketing, and data warehousing.
With Segment configured, you can implement server-side integration with third-party analytics packages (like MixPanel) via our Segment integration
Browse to your Segment account home page and click Add Source to create a Source that will connect to your brainCould App.
Click this source and navigate to setting tab and API Keys section from the left panel, note down the SourceID and Write Key.
Switch back to brainCloud portal Manage Integrations page. Check [ Enable Segment Integration] checkbox and put the required fields of your Segment Project ID (SourceID) and Write Key. Click [ Save Changes ] button to save the configuration to brainCoud.
Log out your brainCloud portal account and log in again, then browse to Design | Cloud Code | API Explorer page.
After authenticating a user, find DataStream Sevice and CustomPageEvent Operation, and run it. And run the other three other types of Events under this Operation selection as well. (CustomScreenEvent, CustomTrackEvent, SubmitCrashReport)
Open your Segment home page, check the tracking events from your associated Segment source from Debugger tab.
Note: There are many other events of your app that will be sent to Segment data hub as well, such as PostedTournamentScore, JoinedTournament, JoinedDivison, Identity Registered, etc. Those events will be classified to Identify: the user, Page and Screen: on what web page or app screen, Track: the specific action.
Navigate to Connections screen from the left panel, click the [Add Destination] button, choose your analytical platform and add to your brainCloud app associated source. You can select more than one platform to add.
Integrate the destination platform with Segment. The integration processing varies on the platforms, follow their individual document to achieve it. For example, in order to integrate Amplitude, you need to create a project and input your Amplitude API Key to Segment.
Save your Amplitude project API Key to Segment from the destination setting page.
Test the data delivery by selecting one event from the live events list and select the test destination to send it.
You should get the destination response from the Event Lifecycle screen.
Open your destination platform dashboard and check the sent test event. For Amplitude, find your project and check it from the Events tab. You can start to make your own custom data analysis dashboard on Amplitude then.
Kafka Integration
brainCloud offers Kafka integration in addition to Segment integration for DataStream events as well.
With Kafka and Segment, both supported out-of-the-box, there are literally hundreds (if not thousands) of systems that you can hook up to your brainCloud apps for deeper data analytics, data mining, etc.
Select a Kafka server provider and create a new Kafka instance on the server. Download the certs and keep it at your local file system somewhere for later use.
Create a Topic from the instance dashboard in order to hold the steaming event from brainCloud.
Find out the connection details of your brokers' server, the security protocol which is applying for the broker's connection, and SASL Mechanism if applicable.
Navigate to brainCloud Design | Integrations | Manage Integrations page and scroll to the Kafka section. Check [Enable Apache Kafka integration] checkbox.
Fill the info which you get from your Kafka server instance above to the required fields, and click [ Save Changes] button to save these configurations.
Note: for brokers field, make sure to fill every broker server with port number and separate each with a comma(",").
Log out your brainCloud portal account and log in again, then browse to Design | Cloud Code | API Explorer page.
After authenticating a user, find DataStream Sevice and CustomPageEvent Operation, and run it. And run the other three other types of Events under this Operation selection as well. (CustomScreenEvent, CustomTrackEvent, SubmitCrashReport)
Go back to your Kafka server instance dashboard, you should be able to consume/read the events logs which brainCloud produced if configurations are correctly set.
Check the consumer history record then.
In most cases, you probably want to consume the events from your App, you should install the associated Kafka SDK and call the steam APIs to get these data. Your code might be similar to the example below.
public void consume() {
KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);
consumer.subscribe(Arrays.asList(topic));
while (true) {
ConsumerRecords<String, String> records = consumer.poll(1000);
for (ConsumerRecord<String, String> record : records) {
System.out.printf("%s [%d] offset=%d, key=%s, value=\"%s\"\n",
record.topic(), record.partition(),
record.offset(), record.key(), record.value());
}
}
}
SAML Integration
brainCloud has been enhanced to support SAML for end-user authentication. This is mostly relevant for non-gaming* customers who want to integrate their brainCloud app with a corporate directory.
Our SAML authentication builds upon the External Authentication feature, providing several key endpoints that can be used for initiating calls and receiving callback from the SAML identity provider.
For more information, see Configuring SAML SSO.
Slack Integration
With Slack integration, you can configure a custom channel (or channels) to receive alerts from selected categories, including:
chat - profanity filter violations
deploys - app deployments
hosting - room servers spinning up / down
integration - push notification expiry warnings
jobs - background reporting jobs started / completed
purchases - customer purchase notifications
Refer to this knowledge base article for the detailed implementation on configuring the Slack webhooks for integration.
Note: you can put only one Slack webhook URL to the Default Channel which will receive all categories alters, or you can separately put the different Slack webhook URLs to individual category channel which will only receive the specified category alerts.
SendGrid Integration
brainCloud has SendGrid transaction email integration. By integrating brainCloud with their own SendGrid account, app developers can:
Utilize SendGrid for all Email Authentication-related emails (validation, reset password, etc.)
Customize the brainCloud-generated emails using SendGrid's template feature
Send emails to users via the new brainCloud Mail API
Refer to this knowledge base article for instructions on configuring the SendGrid for integration.
WebPurify Integration
By configuring WebPurify integrations with your brainCloud app, you can utilize it to replace any profanity that might occur in your app chat/message or other specified fields.
Navigate to WebPurify website and create an account, go to the dashboard and click View your account, you will find an API Key under your account stats.
Scroll down to Customize Filter section to add the words to Block List or Allow List as you will. For example, if you add "amazon" onto the Block List, when you do the profanity check, the word "amazon" will be returned as a foundList.
Go back to brainCloud portal Design | Integrations | Manage Integrations page. Check the [Enable WebPurify Integration] checkbox. Copy that API Key over to brainCloud portal WebPurify configuration section API Key field, and select the filter languages, and tick the user names filter if you want.
Browse to Design | Cloud Code | API Explorer page.
After authenticating a user, find Profanity Sevice and ProfanityIdentifyBadWords Operation, and run it as below. And play with the other two APIs under this Operation selection as well. (ProfanityCheck and ProfanityReplaceText)
(Note: Since we set "amazon" as a block word from WebPurify website configuration above, so the response will return it as a foundCount.)
Check the profanity detection stats change from WebPurify account after a few brainCloud profanity API calls.
Note:
ProfanityCheck() returns the number of foundCount;
ProfanityReplaceText() will actually replace bad words with a substitution character that you provide;
ProfanityIdentifyBadWords() returns a list of the bad words found (mostly useful for debugging).