Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/android-cpp-browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ on:
- 'android-cpp/**'
- '.github/workflows/android-cpp-browserstack.yml'
workflow_dispatch: # Allow manual trigger
inputs:
websocket_url:
description: 'Custom Ditto websocket URL (optional, defaults to secret)'
required: false
type: string
app_id:
description: 'Custom Ditto app ID (optional, defaults to secret)'
required: false
type: string
playground_token:
description: 'Custom Ditto playground token (optional, defaults to secret)'
required: false
type: string
auth_url:
description: 'Custom Ditto auth URL (optional, defaults to secret)'
required: false
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -49,10 +66,10 @@ jobs:

- name: Create .env file
run: |
echo "DITTO_APP_ID=${{ secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ secrets.DITTO_WEBSOCKET_URL }}" >> .env
echo "DITTO_APP_ID=${{ github.event.inputs.app_id || secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ github.event.inputs.playground_token || secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ github.event.inputs.auth_url || secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ github.event.inputs.websocket_url || secrets.DITTO_WEBSOCKET_URL }}" >> .env

- name: Cache Gradle dependencies
uses: actions/cache@v4
Expand Down
33 changes: 25 additions & 8 deletions .github/workflows/android-kotlin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ on:
- 'android-kotlin/**'
- '.github/workflows/android-kotlin-ci.yml'
workflow_dispatch:
inputs:
websocket_url:
description: 'Custom Ditto websocket URL (optional, defaults to secret)'
required: false
type: string
app_id:
description: 'Custom Ditto app ID (optional, defaults to secret)'
required: false
type: string
playground_token:
description: 'Custom Ditto playground token (optional, defaults to secret)'
required: false
type: string
auth_url:
description: 'Custom Ditto auth URL (optional, defaults to secret)'
required: false
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -106,20 +123,20 @@ jobs:
- name: Build APKs
working-directory: android-kotlin/QuickStartTasks
env:
DITTO_APP_ID: ${{ secrets.DITTO_APP_ID }}
DITTO_PLAYGROUND_TOKEN: ${{ secrets.DITTO_PLAYGROUND_TOKEN }}
DITTO_AUTH_URL: ${{ secrets.DITTO_AUTH_URL }}
DITTO_WEBSOCKET_URL: ${{ secrets.DITTO_WEBSOCKET_URL }}
DITTO_APP_ID: ${{ github.event.inputs.app_id || secrets.DITTO_APP_ID }}
DITTO_PLAYGROUND_TOKEN: ${{ github.event.inputs.playground_token || secrets.DITTO_PLAYGROUND_TOKEN }}
DITTO_AUTH_URL: ${{ github.event.inputs.auth_url || secrets.DITTO_AUTH_URL }}
DITTO_WEBSOCKET_URL: ${{ github.event.inputs.websocket_url || secrets.DITTO_WEBSOCKET_URL }}
TEST_DOCUMENT_TITLE: ${{ steps.test_doc.outputs.test_doc_title }}
run: ./gradlew assembleDebug assembleDebugAndroidTest

- name: Run unit tests
working-directory: android-kotlin/QuickStartTasks
env:
DITTO_APP_ID: ${{ secrets.DITTO_APP_ID }}
DITTO_PLAYGROUND_TOKEN: ${{ secrets.DITTO_PLAYGROUND_TOKEN }}
DITTO_AUTH_URL: ${{ secrets.DITTO_AUTH_URL }}
DITTO_WEBSOCKET_URL: ${{ secrets.DITTO_WEBSOCKET_URL }}
DITTO_APP_ID: ${{ github.event.inputs.app_id || secrets.DITTO_APP_ID }}
DITTO_PLAYGROUND_TOKEN: ${{ github.event.inputs.playground_token || secrets.DITTO_PLAYGROUND_TOKEN }}
DITTO_AUTH_URL: ${{ github.event.inputs.auth_url || secrets.DITTO_AUTH_URL }}
DITTO_WEBSOCKET_URL: ${{ github.event.inputs.websocket_url || secrets.DITTO_WEBSOCKET_URL }}
run: ./gradlew test

- name: Upload APK artifacts
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/javascript-web-browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ on:
- 'javascript-web/**'
- '.github/workflows/javascript-web-browserstack.yml'
workflow_dispatch:
inputs:
websocket_url:
description: 'Custom Ditto websocket URL (optional, defaults to secret)'
required: false
type: string
app_id:
description: 'Custom Ditto app ID (optional, defaults to secret)'
required: false
type: string
playground_token:
description: 'Custom Ditto playground token (optional, defaults to secret)'
required: false
type: string
auth_url:
description: 'Custom Ditto auth URL (optional, defaults to secret)'
required: false
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -39,10 +56,10 @@ jobs:

- name: Create .env file
run: |
echo "DITTO_APP_ID=${{ secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ secrets.DITTO_WEBSOCKET_URL }}" >> .env
echo "DITTO_APP_ID=${{ github.event.inputs.app_id || secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ github.event.inputs.playground_token || secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ github.event.inputs.auth_url || secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ github.event.inputs.websocket_url || secrets.DITTO_WEBSOCKET_URL }}" >> .env

- name: Insert test document into Ditto Cloud
run: |
Expand Down
41 changes: 29 additions & 12 deletions .github/workflows/swift-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@ on:
push:
branches: [main, 'sdk-*']
workflow_dispatch:
inputs:
websocket_url:
description: 'Custom Ditto websocket URL (optional, defaults to secret)'
required: false
type: string
app_id:
description: 'Custom Ditto app ID (optional, defaults to secret)'
required: false
type: string
playground_token:
description: 'Custom Ditto playground token (optional, defaults to secret)'
required: false
type: string
auth_url:
description: 'Custom Ditto auth URL (optional, defaults to secret)'
required: false
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -70,10 +87,10 @@ jobs:

- name: Create .env file (production credentials)
run: |
echo "DITTO_APP_ID=${{ secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ secrets.DITTO_WEBSOCKET_URL }}" >> .env
echo "DITTO_APP_ID=${{ github.event.inputs.app_id || secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ github.event.inputs.playground_token || secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ github.event.inputs.auth_url || secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ github.event.inputs.websocket_url || secrets.DITTO_WEBSOCKET_URL }}" >> .env

- name: Generate Env.swift (production)
working-directory: swift
Expand Down Expand Up @@ -122,10 +139,10 @@ jobs:

- name: Create .env file (production credentials)
run: |
echo "DITTO_APP_ID=${{ secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ secrets.DITTO_WEBSOCKET_URL }}" >> .env
echo "DITTO_APP_ID=${{ github.event.inputs.app_id || secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ github.event.inputs.playground_token || secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ github.event.inputs.auth_url || secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ github.event.inputs.websocket_url || secrets.DITTO_WEBSOCKET_URL }}" >> .env

- name: Generate Env.swift (production)
working-directory: swift
Expand Down Expand Up @@ -228,10 +245,10 @@ jobs:

- name: Create .env file (production credentials for BrowserStack API)
run: |
echo "DITTO_APP_ID=${{ secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ secrets.DITTO_WEBSOCKET_URL }}" >> .env
echo "DITTO_APP_ID=${{ github.event.inputs.app_id || secrets.DITTO_APP_ID }}" > .env
echo "DITTO_PLAYGROUND_TOKEN=${{ github.event.inputs.playground_token || secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
echo "DITTO_AUTH_URL=${{ github.event.inputs.auth_url || secrets.DITTO_AUTH_URL }}" >> .env
echo "DITTO_WEBSOCKET_URL=${{ github.event.inputs.websocket_url || secrets.DITTO_WEBSOCKET_URL }}" >> .env

- name: Generate Env.swift (production for XCUITest build)
working-directory: swift
Expand Down
6 changes: 6 additions & 0 deletions react-native/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
DITTO_APP_ID,
DITTO_PLAYGROUND_TOKEN,
DITTO_AUTH_URL,
DITTO_WEBSOCKET_URL,
} from '@env';

import Fab from './components/Fab';
Expand Down Expand Up @@ -132,6 +133,11 @@ const App = () => {

ditto.current = await Ditto.open(config);

// Configure websocket URL for transport
ditto.current.updateTransportConfig((transportConfig) => {
transportConfig.connect.websocketURLs = [DITTO_WEBSOCKET_URL];
});

if (connectConfig.mode === 'server') {
await ditto.current.auth.setExpirationHandler(async (dittoInstance, timeUntilExpiration) => {
console.log('Authentication expiring soon, time until expiration:', timeUntilExpiration);
Expand Down
Loading
Loading