Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add format revealed data #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tecnoloco
Copy link

This will add the capability to format revealed data according to VGS Show Android and IOS documentation.

Example of usage

import VgsShowAttribute from 'vgs-show-react-native';
// ...
const vgsShow = React.useRef<VgsShowAttribute> = null;
<VgsShowAttribute
  ref={vgsShow}
  initParams={{
    environment: ENV,
    vaultId: VAULT_ID,
    // optional, if needed for the upstream service
    customHeaders: {
      Authorization: 'Bearer ' + customerToken,
    },
  }}
  format={{
    pattern:"(\\d{4})(\\d{4})(\\d{4})(\\d{4})"
    template:"$1 $2 $3 $4"
  }}
  contentPath="data.attributes.pan"
  placeholder="Value will appear here"
  style={styles.box}
/>;
// To trigger reveal:
<Button onPress={vgsShow.current?.reveal(PATH, METHOD, CUSTOM_PAYLOAD)}>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant