Skip to content
Merged
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
39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
[![Test](https://github.com/flagship-io/flagship-ts-sdk/actions/workflows/ci_push.yml/badge.svg)](https://github.com/flagship-io/flagship-ts-sdk/actions/workflows/ci_push.yml) [![codecov](https://codecov.io/gh/flagship-io/flagship-ts-sdk/branch/main/graph/badge.svg?token=IW0NWPTPSH)](https://codecov.io/gh/flagship-io/flagship-ts-sdk) [![npm version](https://badge.fury.io/js/@flagship.io%2Fjs-sdk.svg)](https://badge.fury.io/js/@flagship.io%2Fjs-sdk)

## About Flagship

<img src="https://www.flagship.io/wp-content/uploads/Flagship-horizontal-black-wake-AB.png" alt="drawing" width="150"/>
<img src="https://www.abtasty.com/wp-content/uploads/2024/01/cropped-logo-abtasty-green.png" alt="drawing" width="150"/>
[Flagship by AB Tasty](https://www.flagship.io/) is a feature flagging platform for modern engineering and product teams. It eliminates the risks of future releases by separating code deployments from these releases :bulb: With Flagship, you have full control over the release process. You can:
[Flagship by AB Tasty](https://www.abtasty.com) is a feature flagging platform for modern engineering and product teams. It eliminates the risks of future releases by separating code deployments from these releases :bulb: With Flagship, you have full control over the release process. You can:

- Switch features on or off through remote config.
- Automatically roll-out your features gradually to monitor performance and gather feedback from your most relevant users.
- Roll back any feature should any issues arise while testing in production.
- Segment users by granting access to a feature based on certain user attributes.
- Carry out A/B tests by easily assigning feature variations to groups of users.
<img src="https://www.flagship.io/wp-content/uploads/demo-setup.png" alt="drawing" width="600"/>
Flagship also allows you to choose whatever implementation method works for you from our many available SDKs or directly through a REST API. Additionally, our architecture is based on multi-cloud providers that offer high performance and highly-scalable managed services.
**To learn more:**
- [Solution overview](https://www.flagship.io/#showvideo) - A 5mn video demo :movie_camera:
- [Documentation](https://docs.abtasty.com/server-side/sdks/react-native) - Our dev portal with guides, how tos, API and SDK references
- [Sign up for a free trial](https://www.flagship.io/sign-up/) - Create your free account
- [Guide to feature flagging](https://www.flagship.io/feature-flags/) - Everyhting you need to know about feature flag related use cases
- [Blog](https://www.flagship.io/blog/) - Additional resources about release management
- Switch features on or off through remote config.
- Automatically roll-out your features gradually to monitor performance and gather feedback from your most relevant users.
- Roll back any feature should any issues arise while testing in production.
- Segment users by granting access to a feature based on certain user attributes.
- Carry out A/B tests by easily assigning feature variations to groups of users.
Flagship also allows you to choose whatever implementation method works for you from our many available SDKs or directly through a REST API. Additionally, our architecture is based on multi-cloud providers that offer high performance and highly-scalable managed services.
**To learn more:**
- [Solution overview](https://www.abtasty.com/feature-experimentation/) - Discover how Flagship can help you manage your releases and run experiments in production
- [Documentation](https://docs.abtasty.com/server-side/sdks/sdk-overview) - Our dev portal with guides, how tos, API and SDK references
- [Sign up for a free trial](https://www.abtasty.com/get-a-demo/) - Try out Flagship for free and see how it can help you manage your releases and run experiments in production
- [Guide to feature flagging](https://docs.abtasty.com/feature-experimentation-and-rollout) - Everyhting you need to know about feature flag related use cases
- [Blog](https://www.abtasty.com/resources/) - Additional resources about release management
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flagship.io/react-native-sdk",
"version": "5.0.3",
"version": "5.1.0",
"description": "Flagship SDK for React Native",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -22,9 +22,6 @@
"type": "git",
"url": "git+https://github.com/flagship-io/flagship-react-native-sdk.git"
},
"dependencies": {
"@flagship.io/react-sdk": "^5.2.2"
},
"peerDependencies": {
"@react-native-async-storage/async-storage": ">=1.17.0",
"react-native": ">=0.60.0"
Expand Down Expand Up @@ -75,5 +72,8 @@
"ts-jest": "^29.1.0",
"typescript": "^5.0.4"
},
"packageManager": "yarn@4.9.0+sha512.5f5f00843eae735dfab6f0442524603e987ceca55e98b36eb0120f4e58908e5b1406545321e46627dca97d15d562f23dc13fb96cabd4e6bc92d379f619001e4e"
"packageManager": "yarn@4.9.0+sha512.5f5f00843eae735dfab6f0442524603e987ceca55e98b36eb0120f4e58908e5b1406545321e46627dca97d15d562f23dc13fb96cabd4e6bc92d379f619001e4e",
"dependencies": {
"@flagship.io/react-sdk": "^5.2.3"
}
}
19 changes: 17 additions & 2 deletions src/FlagshipProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import { Platform } from 'react-native';
import { version as SDK_VERSION } from './sdkVersion';
import { TouchCaptureProvider } from './TouchCaptureProvider';
import { CLIENT_CACHE_KEY, DEFAULT_POOL_MAX_SIZE, DEFAULT_TIME_INTERVAL, SDK_FIRST_TIME_INIT } from './Constant';
import {
CLIENT_CACHE_KEY,
DEFAULT_POOL_MAX_SIZE,
DEFAULT_TIME_INTERVAL,
SDK_FIRST_TIME_INIT
} from './Constant';
import { ABTastyQAProvider } from './qaAssistant/ABTastyQAProvider';

export interface FlagshipProviderProps
extends Omit<
Expand Down Expand Up @@ -121,9 +127,12 @@ const FlagshipProviderFunc = ({
);
}, [props.trackingManagerConfig]);

const isQAModeEnabled = props.isQAModeEnabled || false;

return (
<ReactFlagshipProvider
{...props}
isQAModeEnabled={isQAModeEnabled}
trackingManagerConfig={trackingConfig}
sdkVersion={SDK_VERSION}
language={2}
Expand All @@ -132,7 +141,13 @@ const FlagshipProviderFunc = ({
visitorData={processedVisitorData}
shouldSaveInstance={true}
>
<TouchCaptureProvider>{children}</TouchCaptureProvider>
<ABTastyQAProvider
isQAModeEnabled={isQAModeEnabled}
envId={props.envId}
apiKey={props.apiKey}
>
<TouchCaptureProvider>{children}</TouchCaptureProvider>
</ABTastyQAProvider>
</ReactFlagshipProvider>
);
};
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export { FlagshipProvider } from './FlagshipProvider'

export type { FlagshipProviderProps } from './FlagshipProvider'

export { useABTastyQA } from './qaAssistant/hooks'

export { ABTastyQA } from './type'


export { useFlagship, UseFlagshipOutput } from './FlagshipHooks'

Expand Down
6 changes: 6 additions & 0 deletions src/qaAssistant/ABTastyQAContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

import { createContext } from "react";
import type { ABTastyQA } from "../type";


export const ABTastyQAContext = createContext<ABTastyQA | null>(null);
30 changes: 30 additions & 0 deletions src/qaAssistant/ABTastyQAProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react';
import { ABTastyQAEventBus } from '@flagship.io/react-sdk';

import { useMemo } from 'react';
import { ABTastyQAContext } from './ABTastyQAContext';

type ABTastyQAProviderProps = {
children: React.ReactNode;
isQAModeEnabled?: boolean;
envId?: string;
apiKey?: string;
};

export function ABTastyQAProvider({
children,
isQAModeEnabled,
envId,
apiKey
}: ABTastyQAProviderProps) {
const ProviderValue = useMemo(
() => ({ ABTastyQAEventBus, isQAModeEnabled, envId, apiKey }),
[isQAModeEnabled, envId, apiKey]
);

return (
<ABTastyQAContext.Provider value={ProviderValue}>
{children}
</ABTastyQAContext.Provider>
);
}
6 changes: 6 additions & 0 deletions src/qaAssistant/hooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { useContext } from "react";
import { ABTastyQAContext } from "./ABTastyQAContext";

export function useABTastyQA() {
return useContext(ABTastyQAContext);
}
2 changes: 1 addition & 1 deletion src/sdkVersion.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Generated by genversion.
export const version = '5.0.3'
export const version = '5.1.0'
9 changes: 8 additions & 1 deletion src/type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { IPageView, IVisitorEvent, Visitor } from "@flagship.io/react-sdk";
import { IPageView, IVisitorEvent, Visitor, ABTastyQAEventBus } from "@flagship.io/react-sdk";

export type VisitorAugmented = typeof Visitor & {
sendEaiPageView: (pageView: IPageView) => void;
sendEaiVisitorEvent: (visitorEvent: IVisitorEvent) => void;
}

export interface ABTastyQA {
ABTastyQAEventBus: typeof ABTastyQAEventBus;
isQAModeEnabled?: boolean;
envId?: string;
apiKey?: string;
}
Loading
Loading